Summary Files Commits Branches @commit @diff @stats
path: root / autoconfig.nix
diff options
context:
space:
mode:
Commitcb613ed855f6661ecac17b696bafc17472256215 (patch)
Author
 Syndamia <kamen@syndamia.com>
2024-07-12 16:38:01 +0300
Committer
 Syndamia <kamen@syndamia.com>
2024-07-12 16:38:01 +0300
Files5c8a381e55f6d011c0e3cb1598814ae15f64c5c6 /autoconfig.nix
nix-cb613ed855f6661ecac17b696bafc17472256215.tar
nix-cb613ed855f6661ecac17b696bafc17472256215.tar.gz
nix-cb613ed855f6661ecac17b696bafc17472256215.zip
Parent279900a9a5b4d4a1ffb9bf5d29ce0afd8ad33ae2 (diff)
[modules] Added subtypes to modules
1 files changed, 5 insertions, 3 deletions
-rw-r--r--autoconfig.nix8
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;