From 680369e504e9c241fdbd1d7621a7c3011649edcc Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Wed, 30 Nov 2022 18:24:11 +0100 Subject: [PATCH] nixos/activation/bootspec: add some comments to explain the delicate manipulations --- nixos/modules/system/activation/bootspec.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/activation/bootspec.nix b/nixos/modules/system/activation/bootspec.nix index 170c07e7daf7..2d4f7158dd46 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}