diff options
1 files changed, 7 insertions, 16 deletions
| -rw-r--r-- | autoconfig.nix | 23 |
diff --git a/autoconfig.nix b/autoconfig.nix index cd40ee7..5debdc2 100644 --- a/autoconfig.nix +++ b/autoconfig.nix @@ -7,33 +7,24 @@ in { lib.mapAttrs (dir: _: let - sysidentity = import ./machines/${dir}/sysidentity.nix; + sysidentity = (import ./machines/${dir}/sysidentity.nix) (import ./module-groups.nix); + # TODO: rework modules-dir = ./modules + ("/" + (if sysidentity ? "modules-subpath" then sysidentity.modules-subpath else "personal")); package-modules = let - listget = attrname: + getmodules = attrname: if sysidentity ? ${attrname} then map (v: modules-dir + ("/" + v + (if lib.hasSuffix ".nix" v then "" else ".nix"))) sysidentity.${attrname} else []; - 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 startsempty - then listget "have" - else lib.mapAttrsToList - (name: _: modules-dir + ("/" + name)) - (lib.filterAttrs (_: type: type == "regular") (builtins.readDir modules-dir)); + + includelist = getmodules "include"; + excludelist = getmodules "exclude"; in - (lib.subtractLists droplist modulelist) ++ havelist; + lib.subtractLists excludelist includelist; inputs-overlays = lib.mapAttrs |
