[Boot] fix last boot marking for Nixos 23.11 + fix issue when not booted into a specialization

This commit is contained in:
Antoine Viallon 2024-01-10 21:52:48 +01:00
parent 39edefcc88
commit 9c999a070d
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -318,6 +318,7 @@ in {
extraInstallCommands = let
efiDir = config.boot.loader.efi.efiSysMountPoint;
in ''
export PATH="$PATH:${getBin pkgs.coreutils-full}/bin:${getBin pkgs.gnused}/bin"
rpath=
generation=
specialization=
@ -329,9 +330,10 @@ in {
echo "Good path: $path"
ok=true
fi
for specialization in "$path"/specialisation/*; do
if [ "$(realpath $specialization)" = "$boot_generation_path" ]; then
for spec in "$path"/specialisation/*; do
if [ "$(realpath $spec)" = "$boot_generation_path" ]; then
ok=true
specialization="$spec"
echo "Good specialization: $specialization"
break
fi