Merge pull request #77594 from Frostman/fix-grub-extrafiles-mirroredboots
Fix boot.loader.grub.extraFiles when used with mirroredBoots
commitb4cc4139284e2cd73ed5c19761b081bebc6d51db
authorSilvan Mosberger <contact@infinisil.com>
dateWed 5 Feb 2020, 00:22 (7 years ago)
parentb27f8067144b9a
nixos/modules/system/boot/loader/grub/grub.nix+1−1
@@ -630,7 +630,7 @@ in
630630
631631 boot.loader.grub.extraPrepareConfig =
632632 concatStrings (mapAttrsToList (n: v: ''
633− ${pkgs.coreutils}/bin/cp -pf "${v}" "/boot/${n}"
633+ ${pkgs.coreutils}/bin/cp -pf "${v}" "@bootPath@/${n}"
634634 '') config.boot.loader.grub.extraFiles);
635635
636636 assertions = [
nixos/modules/system/boot/loader/grub/install-grub.pl+3
@@ -475,6 +475,9 @@ if ($grubVersion == 2) {
475475 }
476476}
477477
478+# extraPrepareConfig could refer to @bootPath@, which we have to substitute
479+$extraPrepareConfig =~ s/\@bootPath\@/$bootPath/g;
480+
478481# Run extraPrepareConfig in sh
479482if ($extraPrepareConfig ne "") {
480483 system((get("shell"), "-c", $extraPrepareConfig));