diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix index 3a7f0d19db94..b19e3ac5c787 100644 --- a/nixos/modules/system/boot/kernel.nix +++ b/nixos/modules/system/boot/kernel.nix @@ -414,7 +414,9 @@ in ln -s ${initrdPath} $out/initrd - ln -s ${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets $out + ${optionalString (config.boot.initrd.secrets != { }) '' + ln -s ${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets $out + ''} ln -s ${config.hardware.firmware}/lib/firmware $out/firmware '';