diff options
author | Raito Bezarius <masterancpp@gmail.com> | 2022-11-30 18:24:11 +0100 |
---|---|---|
committer | Cole Helbling <cole.e.helbling@outlook.com> | 2022-12-08 13:50:05 -0800 |
commit | 680369e504e9c241fdbd1d7621a7c3011649edcc (patch) | |
tree | 0d914137ffbe8e729018ace38767d576511dec25 /nixos/modules/system | |
parent | 11dfbee0a4a2309515608a890e91d4d1a2a43626 (diff) |
nixos/activation/bootspec: add some comments to explain the delicate manipulations
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/activation/bootspec.nix | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nixos/modules/system/activation/bootspec.nix b/nixos/modules/system/activation/bootspec.nix index 170c07e7daf74..2d4f7158dd46e 100644 --- a/nixos/modules/system/activation/bootspec.nix +++ b/nixos/modules/system/activation/bootspec.nix @@ -38,6 +38,9 @@ let '' mkdir -p $out/bootspec + # Inject toplevel and init in the bootspec. + # This can be done only here because we *cannot* depend on $out, except + # by living in $out itself. ${pkgs.jq}/bin/jq ' .v1.toplevel = $toplevel | .v1.init = $init @@ -47,7 +50,7 @@ let --arg init "$out/init" \ < ${json} \ | ${pkgs.jq}/bin/jq \ - --sort-keys \ + --sort-keys \ # Slurp all specialisations and inject them as values in .specialisations.{name} = {specialisation bootspec}. '.v1.specialisation = ($ARGS.named | map_values(. | first | .v1))' \ ${lib.concatStringsSep " " specialisationLoader} \ > $out/bootspec/${filename} |