Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitd885c729ca9e21af2779cb04377012086589d8c3 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-01 12:10:59 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-01 12:10:59 +0300
Filesda3373420bbfd5bd3181f832cbb0c882af44d1a4
nix-d885c729ca9e21af2779cb04377012086589d8c3.tar
nix-d885c729ca9e21af2779cb04377012086589d8c3.tar.gz
nix-d885c729ca9e21af2779cb04377012086589d8c3.zip
Parent5219e0fd427cbac3da24f5a62f1e8eed0ab16b8b (diff)
feat(module-groups): Make module groups different for every system kind
2 files changed, 28 insertions, 17 deletions
-rw-r--r--autoconfig.nix8
-rw-r--r--module-groups.nix37
diff --git a/autoconfig.nix b/autoconfig.nix
index 5432b1b..f830bcb 100644
--- a/autoconfig.nix
+++ b/autoconfig.nix
@@ -16,7 +16,13 @@ in {
# include = []; # names of files inside ./modules/kind/ which to be included, by default only default.nix is
# exclude = []; # names of files inside ./modules/kind/ which to be excluded (from include)
# }
- sysidentity = (import ./machines/${dir}/sysidentity.nix) (import ./module-groups.nix);
+ sysidentity =
+ let
+ group-definitions = import ./module-groups.nix;
+ func-sysidentity = import ./machines/${dir}/sysidentity.nix;
+ inherit (func-sysidentity { }) kind;
+ in
+ func-sysidentity (group-definitions.${kind} // group-definitions.all or {});
modules-dir = lib.path.append ./modules sysidentity."kind";
diff --git a/module-groups.nix b/module-groups.nix
index dbd00fc..a2e777f 100644
--- a/module-groups.nix
+++ b/module-groups.nix
@@ -1,20 +1,25 @@
rec {
- barebones = [ "cli-essential" "fonts" "users-standard" ];
+ all = {
+ barebones = [ "cli-essential" "fonts" "users-standard" ];
+ };
- personal = barebones ++ [ # default.nix is always included by autoconfig
- "hardware-general" "virtualization"
- # GUI
- "gui-essential" "xserver" "openbox-de"
- # Work/development
- "cli-powerful" "dev-cli" "tex" "web-server"
- # Custom hardware
- "keyboards-custom" "rtl-sdr"
- ];
- desktop = personal ++ [
- "dev-gui" "gui-powerful"
- ];
- laptop = personal ++ [
- "battery" "hardware-laptop"
- ];
+ personal = rec {
+ personal = all.barebones ++ [ # default.nix is always included by autoconfig
+ "hardware-general" "virtualization"
+ # GUI
+ "gui-essential" "xserver" "openbox-de"
+ # Work/development
+ "cli-powerful" "dev-cli" "tex" "web-server"
+ # Custom hardware
+ "keyboards-custom" "rtl-sdr"
+ ];
+
+ desktop = personal ++ [
+ "dev-gui" "gui-powerful"
+ ];
+ laptop = personal ++ [
+ "battery" "hardware-laptop"
+ ];
+ };
}