Fix boot.loader.grub.extraFiles when used with mirroredBoots

Substitute @bootPath@ in boot.loader.grub.extraPrepareConfig script
same way as it's done for boot.loader.grub.extraEntries option.
This commit is contained in:
Sergey Lukjanov 2020-01-12 19:39:03 -08:00
parent c636a45e67
commit 7144b9ac54
2 changed files with 4 additions and 1 deletions

View File

@ -630,7 +630,7 @@ in
boot.loader.grub.extraPrepareConfig = boot.loader.grub.extraPrepareConfig =
concatStrings (mapAttrsToList (n: v: '' concatStrings (mapAttrsToList (n: v: ''
${pkgs.coreutils}/bin/cp -pf "${v}" "/boot/${n}" ${pkgs.coreutils}/bin/cp -pf "${v}" "@bootPath@/${n}"
'') config.boot.loader.grub.extraFiles); '') config.boot.loader.grub.extraFiles);
assertions = [ assertions = [

View File

@ -475,6 +475,9 @@ if ($grubVersion == 2) {
} }
} }
# extraPrepareConfig could refer to @bootPath@, which we have to substitute
$extraPrepareConfig =~ s/\@bootPath\@/$bootPath/g;
# Run extraPrepareConfig in sh # Run extraPrepareConfig in sh
if ($extraPrepareConfig ne "") { if ($extraPrepareConfig ne "") {
system((get("shell"), "-c", $extraPrepareConfig)); system((get("shell"), "-c", $extraPrepareConfig));