From b269e6853e233f5bd2365930860bfa53188cfebb Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sun, 22 Oct 2023 12:19:59 +0100 Subject: [PATCH] nixos-rebuild: fix --install-bootloader flag with systemd-run --- pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh index 68e00690652e..9e75db6d27b5 100755 --- a/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh +++ b/pkgs/os-specific/linux/nixos-rebuild/nixos-rebuild.sh @@ -659,6 +659,7 @@ if [[ "$action" = switch || "$action" = boot || "$action" = test || "$action" = cmd=( "systemd-run" "-E" "LOCALE_ARCHIVE" # Will be set to new value early in switch-to-configuration script, but interpreter starts out with old value + "-E" "NIXOS_INSTALL_BOOTLOADER" "--collect" "--no-ask-password" "--pty" @@ -679,7 +680,12 @@ if [[ "$action" = switch || "$action" = boot || "$action" = test || "$action" = cmd=() elif ! targetHostCmd "${cmd[@]}" true &>/dev/null; then logVerbose "Skipping systemd-run to switch configuration since it is not working in target host." - cmd=("env" "-i" "LOCALE_ARCHIVE=$LOCALE_ARCHIVE") + cmd=( + "env" + "-i" + "LOCALE_ARCHIVE=$LOCALE_ARCHIVE" + "NIXOS_INSTALL_BOOTLOADER=$NIXOS_INSTALL_BOOTLOADER" + ) else logVerbose "Using systemd-run to switch configuration." fi