diff options
Diffstat (limited to 'pkgs/populate/lib/default.nix')
| -rw-r--r-- | pkgs/populate/lib/default.nix | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/populate/lib/default.nix b/pkgs/populate/lib/default.nix index e9155c5..4ccc609 100644 --- a/pkgs/populate/lib/default.nix +++ b/pkgs/populate/lib/default.nix @@ -20,7 +20,8 @@ in rec { # The sources, a list of attribute sets of sources by name, or one, with # shorthands expanded and defaults filled in, and without settings that - # are null, as populate reads them, e.g. with builtins.toJSON. + # are null, as populate reads them, e.g. with builtins.toJSON. Sources + # whose type is set to null are left out. evalSource = let eval = source: lib.evalModules { modules = lib.singleton { @@ -42,7 +43,14 @@ in rec { string = x; }; in - source: sanitize (eval source).config.source; + source: sanitize + (lib.filterAttrs (_: source: source.type != null) + (eval source).config.source); + + # The settings of a source type if cond holds, else null, which leaves + # the source out unless another type is set, e.g. + # nixpkgs.file = optionalSource local { path = ...; }; + optionalSource = cond: settings: if cond then settings else null; # Inputs a source draws from other sources, as list of attribute sets like # { path = [ "stockholm" "nixpkgs" ]; source = "nixpkgs"; }. |
