diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index 9a3138ff37eb..7f2d388b8af3 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -412,7 +412,9 @@ in echo -n "$kernelParams" > $out/kernel-params - ln -s ${initrdPath} $out/initrd + ${optionalString config.boot.initrd.enable '' + ln -s ${initrdPath} $out/initrd + ''} ${optionalString (config.boot.initrd.secrets != { }) '' ln -s ${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets $out