diff options
1 files changed, 9 insertions, 4 deletions
| -rw-r--r-- | autoconfig.nix | 13 |
diff --git a/autoconfig.nix b/autoconfig.nix index 5da9c3a..7434a79 100644 --- a/autoconfig.nix +++ b/autoconfig.nix @@ -17,16 +17,21 @@ in { (v: ./modules + ("/" + v + (if lib.hasSuffix ".nix" v then "" else ".nix"))) sysidentity.${attrname} else []; - havelist = listget "have"; droplist = listget "drop"; + startsempty = (sysidentity ? defaultempty) && sysidentity.defaultempty; + # When we start empty, we expect to have many packages in "have" + # but when we don't start empty, we expect to have many packages in "modelist" + # So it makes more sense to make droplist remove items from the "many packages" + # list, instead of only one of the two, or both + havelist = if startsempty then listget "have" else []; modulelist = - if (sysidentity ? defaultempty) && sysidentity.defaultempty - then [] + if startsempty + then listget "have" else lib.mapAttrsToList (name: _: ./modules + ("/" + name)) (lib.filterAttrs (_: type: type == "regular") (builtins.readDir ./modules)); in - lib.subtractLists droplist (havelist ++ modulelist); + (lib.subtractLists droplist modulelist) ++ havelist; inputs-overlays = lib.mapAttrs |
