nixos-rebuild: Fix target-host using fish

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.
This commit is contained in:
Jan Tojnar 2019-10-08 11:43:05 +02:00
parent 2436c27541
commit 316d4faba4
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
1 changed files with 1 additions and 1 deletions

View File

@ -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