From cb613ed855f6661ecac17b696bafc17472256215 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 12 Jul 2024 16:38:01 +0300 Subject: [modules] Added subtypes to modules --- autoconfig.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'autoconfig.nix') diff --git a/autoconfig.nix b/autoconfig.nix index 7434a79..7534315 100644 --- a/autoconfig.nix +++ b/autoconfig.nix @@ -9,12 +9,14 @@ in { let inherit (import ./machines/${dir}/sysidentity.nix) sysidentity; + modules-dir = ./modules + ("/" + (if sysidentity ? "modules-subpath" then sysidentity.modules-subpath else "personal")); + package-modules = let listget = attrname: if sysidentity ? ${attrname} then map - (v: ./modules + ("/" + v + (if lib.hasSuffix ".nix" v then "" else ".nix"))) + (v: modules-dir + ("/" + v + (if lib.hasSuffix ".nix" v then "" else ".nix"))) sysidentity.${attrname} else []; droplist = listget "drop"; @@ -28,8 +30,8 @@ in { if startsempty then listget "have" else lib.mapAttrsToList - (name: _: ./modules + ("/" + name)) - (lib.filterAttrs (_: type: type == "regular") (builtins.readDir ./modules)); + (name: _: modules-dir + ("/" + name)) + (lib.filterAttrs (_: type: type == "regular") (builtins.readDir modules-dir)); in (lib.subtractLists droplist modulelist) ++ havelist; -- cgit v1.3.1-26-gb76a