commit 56c667cfd5d862df2bdb240e86e13f3e8b73ada6
parent f9b4f0bc9c36802f543f1b1f7e58f98de20a289d
Author: Daniel Barlow <dan@telent.net>
Date: Thu, 19 Dec 2024 20:55:10 +0000
extract systemConfiguration into its own output module
Diffstat:
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/modules/outputs/initramfs.nix b/modules/outputs/initramfs.nix
@@ -9,6 +9,7 @@ let
inherit (pkgs) runCommand;
in
{
+ imports = [ ./system-configuration.nix ];
options = {
boot.initramfs = {
enable = mkEnableOption "initramfs";
@@ -22,14 +23,6 @@ in
filesystem
'';
};
- systemConfiguration = mkOption {
- type = types.package;
- description = ''
- pkgs.systemconfig for the configured filesystem,
- contains 'activate' and 'init' commands
- '';
- internal = true;
- };
};
};
config = mkIf config.boot.initramfs.enable {
@@ -53,8 +46,6 @@ in
file /init ${pkgs.preinit}/bin/preinit 0755 0 0
SPECIALS
'';
- systemConfiguration =
- pkgs.systemconfig config.filesystem.contents;
};
};
}
diff --git a/modules/outputs/system-configuration.nix b/modules/outputs/system-configuration.nix
@@ -0,0 +1,28 @@
+{
+ config
+, pkgs
+, lib
+, ...
+}:
+let
+ inherit (lib) mkEnableOption mkOption mkIf types;
+ inherit (pkgs) runCommand;
+in
+{
+ options = {
+ system.outputs = {
+ systemConfiguration = mkOption {
+ type = types.package;
+ description = ''
+ pkgs.systemconfig for the configured filesystem,
+ contains 'activate' and 'init' commands
+ '';
+ internal = true;
+ };
+ };
+ };
+ config = {
+ system.outputs.systemConfiguration =
+ pkgs.systemconfig config.filesystem.contents;
+ };
+}