diff --git a/website/structure/collections.nix b/website/structure/collections.nix index a4f4fa66..3ddb5d32 100644 --- a/website/structure/collections.nix +++ b/website/structure/collections.nix @@ -34,7 +34,7 @@ in name = mkOption { description = "Symbolic name, used as a human-readable identifier"; type = types.str; - default = name; + default = lib.mkDefault name; }; prefixes = mkOption { description = '' @@ -52,12 +52,17 @@ in }; entry = mkOption { description = "An entry in the collection"; - type = types.collection (types.submodule ({ + type = with types; collection (submodule ({ imports = [ config.type ]; _module.args.collection = config; process-locations = ls: with lib; concatMap (l: map (p: "${p}/${l}") config.prefixes) ls; })); }; + by-name = mkOption { + description = "Entries accessible by symbolic name"; + type = with types; attrsOf attrs; + default = with lib; listToAttrs (map (e: { name = e.name; value = e; }) config.entry); + }; }; })); };