From 316d4faba4a3b381e4483a274bbf07b69288257e Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 8 Oct 2019 11:43:05 +0200 Subject: [PATCH] nixos-rebuild: Fix target-host using fish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have `users.defaultUserShell = pkgs.fish;` set on my server and when I ran `nixos-rebuild switch --target-host …`, the command failed with the following error: fish: Unsupported use of '='. To run 'nix-store' with a modified environment, please use 'env PATH=… nix-store…' That is because fish requires env to set environment variables for a program. It should also work on other shells. --- nixos/modules/installer/tools/nixos-rebuild.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh index 6a08c9b4c6c..ea434ca8741 100644 --- a/nixos/modules/installer/tools/nixos-rebuild.sh +++ b/nixos/modules/installer/tools/nixos-rebuild.sh @@ -111,7 +111,7 @@ buildHostCmd() { if [ -z "$buildHost" ]; then "$@" elif [ -n "$remoteNix" ]; then - ssh $SSHOPTS "$buildHost" PATH="$remoteNix:$PATH" "$@" + ssh $SSHOPTS "$buildHost" env PATH="$remoteNix:$PATH" "$@" else ssh $SSHOPTS "$buildHost" "$@" fi