diff options
author | Raito Bezarius <masterancpp@gmail.com> | 2022-12-21 23:28:21 +0100 |
---|---|---|
committer | Raito Bezarius <masterancpp@gmail.com> | 2022-12-21 23:28:21 +0100 |
commit | 5dd2e60371cc749dbccd44719df9a8c18a29d346 (patch) | |
tree | a80d919cef1aac6a5e408292c7c68d6a9ede3bd7 /nixos/modules/system | |
parent | fa09312274c4ff0c93677e534fd5b40bff8cca05 (diff) |
nixos/activation/bootspec: make initrd optional, serialize system, precise extensions' type
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/activation/bootspec.cue | 1 | ||||
-rw-r--r-- | nixos/modules/system/activation/bootspec.nix | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/nixos/modules/system/activation/bootspec.cue b/nixos/modules/system/activation/bootspec.cue index 3fc9ca381df77..9f857a1b1cd80 100644 --- a/nixos/modules/system/activation/bootspec.cue +++ b/nixos/modules/system/activation/bootspec.cue @@ -1,4 +1,5 @@ #V1: { + system: string init: string initrd?: string initrdSecrets?: string diff --git a/nixos/modules/system/activation/bootspec.nix b/nixos/modules/system/activation/bootspec.nix index da76bf9084af8..4255730250afb 100644 --- a/nixos/modules/system/activation/bootspec.nix +++ b/nixos/modules/system/activation/bootspec.nix @@ -19,13 +19,15 @@ let (builtins.toJSON { v1 = { + system = config.boot.kernelPackages.stdenv.hostPlatform.system; kernel = "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}"; kernelParams = config.boot.kernelParams; - initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"; - initrdSecrets = "${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets"; label = "NixOS ${config.system.nixos.codeName} ${config.system.nixos.label} (Linux ${config.boot.kernelPackages.kernel.modDirVersion})"; inherit (cfg) extensions; + } // lib.optionalAttrs config.boot.initrd.enable { + initrd = "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}"; + initrdSecrets = "${config.system.build.initialRamdiskSecretAppender}/bin/append-initrd-secrets"; }; }); @@ -80,7 +82,7 @@ in enable = lib.mkEnableOption (lib.mdDoc "Enable generation of RFC-0125 bootspec in $system/bootspec, e.g. /run/current-system/bootspec"); extensions = lib.mkOption { - type = lib.types.attrs; + type = lib.types.attrsOf lib.types.attrs; # <namespace>: { ...namespace-specific fields } default = { }; description = lib.mdDoc '' User-defined data that extends the bootspec document. |