From 2fe3132bb2bf8e14d0fae9e1d78ff374ae01646b Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 7 Jul 2024 11:07:47 +0300 Subject: [machines] Updated sysidentity and moved stuff from configuration to hardware-configuration --- autoconfig.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'autoconfig.nix') 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 -- cgit v1.3.1-26-gb76a