nixos/top-level.nix: Move configurationName to grub.nix

The configuration-name file is grub specific, so it should not be
in top-level.nix.
This commit is contained in:
Robert Hensing 2022-11-05 00:15:29 +01:00
parent 37fa46a224
commit 9299483604
2 changed files with 5 additions and 3 deletions

View File

@ -59,7 +59,6 @@ let
ln -s ${config.system.path} $out/sw
ln -s "$systemd" $out/systemd
echo -n "$configurationName" > $out/configuration-name
echo -n "systemd ${toString config.systemd.package.interfaceVersion}" > $out/init-interface-version
echo -n "$nixosLabel" > $out/nixos-version
echo -n "${config.boot.kernelPackages.stdenv.hostPlatform.system}" > $out/system
@ -106,8 +105,6 @@ let
dryActivationScript = config.system.dryActivationScript;
nixosLabel = config.system.nixos.label;
configurationName = config.boot.loader.grub.configurationName;
# Needed by switch-to-configuration.
perl = pkgs.perl.withPackages (p: with p; [ ConfigIniFiles FileSlurp ]);
} // config.system.systemBuilderArgs);

View File

@ -748,6 +748,11 @@ in
boot.loader.supportsInitrdSecrets = true;
system.systemBuilderArgs.configurationName = cfg.configurationName;
system.systemBuilderCommands = ''
echo -n "$configurationName" > $out/configuration-name
'';
system.build.installBootLoader =
let
install-grub-pl = pkgs.substituteAll {