mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
system/activation/bootspec: do not synthesize initrdSecrets
if unneeded
We should not always create an appender script if we have no secret, this has no usefulness whatsover.
This commit is contained in:
parent
b3d998e7ea
commit
7c6f64914f
1 changed files with 2 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
let
|
let
|
||||||
cfg = config.boot.bootspec;
|
cfg = config.boot.bootspec;
|
||||||
children = lib.mapAttrs (childName: childConfig: childConfig.configuration.system.build.toplevel) config.specialisation;
|
children = lib.mapAttrs (childName: childConfig: childConfig.configuration.system.build.toplevel) config.specialisation;
|
||||||
|
hasAtLeastOneInitrdSecret = lib.length (lib.attrNames config.boot.initrd.secrets) > 0;
|
||||||
schemas = {
|
schemas = {
|
||||||
v1 = rec {
|
v1 = rec {
|
||||||
filename = "boot.json";
|
filename = "boot.json";
|
||||||
|
@ -27,6 +28,7 @@ let
|
||||||
label = "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})";
|
label = "${config.system.nixos.distroName} ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})";
|
||||||
} // lib.optionalAttrs config.boot.initrd.enable {
|
} // lib.optionalAttrs config.boot.initrd.enable {
|
||||||
initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";
|
initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}";
|
||||||
|
} // lib.optionalAttrs hasAtLeastOneInitrdSecret {
|
||||||
initrdSecrets = "${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets";
|
initrdSecrets = "${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets";
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue