summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1.nix
diff options
context:
space:
mode:
authorWill Fancher <elvishjerricco@gmail.com>2022-03-19 23:00:06 -0400
committerWill Fancher <elvishjerricco@gmail.com>2022-03-22 21:28:43 -0400
commit2d4ebf1259149ac52c191f461eef4eae6c3671fc (patch)
treee7a95cda3d80c24f28a57f0a4a71ee5d665ec9d5 /nixos/modules/system/boot/stage-1.nix
parent25113740a5063483645cab857716a77437cd881e (diff)
downloadnixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.tar
nixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.tar.gz
nixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.tar.bz2
nixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.tar.lz
nixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.tar.xz
nixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.tar.zst
nixpkgs-2d4ebf1259149ac52c191f461eef4eae6c3671fc.zip
initrd: Optional systemd-based initrd
Diffstat (limited to 'nixos/modules/system/boot/stage-1.nix')
-rw-r--r--nixos/modules/system/boot/stage-1.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix
index 1575c0257d1..aa2f4fb860b 100644
--- a/nixos/modules/system/boot/stage-1.nix
+++ b/nixos/modules/system/boot/stage-1.nix
@@ -706,8 +706,12 @@ in
       }
     ];
 
-    system.build =
-      { inherit bootStage1 initialRamdisk initialRamdiskSecretAppender extraUtils; };
+    system.build = mkMerge [
+      { inherit bootStage1 initialRamdiskSecretAppender extraUtils; }
+
+      # generated in nixos/modules/system/boot/systemd/initrd.nix
+      (mkIf (!config.boot.initrd.systemd.enable) { inherit initialRamdisk; })
+    ];
 
     system.requiredKernelConfig = with config.lib.kernelConfig; [
       (isYes "TMPFS")