diff options
author | Raito Bezarius <masterancpp@gmail.com> | 2023-03-18 20:42:09 +0100 |
---|---|---|
committer | Cole Helbling <cole.e.helbling@outlook.com> | 2023-04-28 18:26:11 -0700 |
commit | bc502d0a14964d09be334faae25373c9d8d491bd (patch) | |
tree | f6ad7f0257f25c2ba524ae72ab450f8b66f475f4 /nixos/tests/bootspec.nix | |
parent | b76b960e2eca551554cef2a5e1e5d6f4c2a9b6bc (diff) |
nixos/bootspec: adopt the merged RFC-0125
This removes the feature preview warning, enable by default bootspec, adds a validation flag to prevent Go to go into build-time closure. This will break all downstream users of bootspec as those changes are not backward-compatible.
Diffstat (limited to 'nixos/tests/bootspec.nix')
-rw-r--r-- | nixos/tests/bootspec.nix | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/nixos/tests/bootspec.nix b/nixos/tests/bootspec.nix index f388a15ffa2d7..9295500422a92 100644 --- a/nixos/tests/bootspec.nix +++ b/nixos/tests/bootspec.nix @@ -110,7 +110,7 @@ in machine.succeed("test -e /run/current-system/boot.json") - bootspec = json.loads(machine.succeed("jq -r '.v1' /run/current-system/boot.json")) + bootspec = json.loads(machine.succeed("jq -r '.\"org.nixos.bootspec.v1\"' /run/current-system/boot.json")) assert all(key in bootspec for key in ('initrd', 'initrdSecrets')), "Bootspec should contain initrd or initrdSecrets field when initrd is enabled" ''; @@ -136,10 +136,10 @@ in machine.succeed("test -e /run/current-system/boot.json") machine.succeed("test -e /run/current-system/specialisation/something/boot.json") - sp_in_parent = json.loads(machine.succeed("jq -r '.v1.specialisation.something' /run/current-system/boot.json")) + sp_in_parent = json.loads(machine.succeed("jq -r '.\"org.nixos.specialisation.v1\".something' /run/current-system/boot.json")) sp_in_fs = json.loads(machine.succeed("cat /run/current-system/specialisation/something/boot.json")) - assert sp_in_parent == sp_in_fs['v1'], "Bootspecs of the same specialisation are different!" + assert sp_in_parent['org.nixos.bootspec.v1'] == sp_in_fs['org.nixos.bootspec.v1'], "Bootspecs of the same specialisation are different!" ''; }; @@ -152,7 +152,9 @@ in imports = [ standard ]; environment.systemPackages = [ pkgs.jq ]; boot.bootspec.extensions = { - osRelease = config.environment.etc."os-release".source; + "org.nix-tests.product" = { + osRelease = config.environment.etc."os-release".source; + }; }; }; @@ -161,7 +163,7 @@ in machine.wait_for_unit("multi-user.target") current_os_release = machine.succeed("cat /etc/os-release") - bootspec_os_release = machine.succeed("cat $(jq -r '.v1.extensions.osRelease' /run/current-system/boot.json)") + bootspec_os_release = machine.succeed("cat $(jq -r '.\"org.nix-tests.product\".osRelease' /run/current-system/boot.json)") assert current_os_release == bootspec_os_release, "Filename referenced by extension has unexpected contents" ''; |