Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos-rebuild: Fix target-host using fish #70734

Merged
merged 1 commit into from
Oct 11, 2019

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Oct 8, 2019

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.

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.
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 8, 2019
@jtojnar jtojnar merged commit 1739d34 into NixOS:master Oct 11, 2019
@jtojnar jtojnar deleted the nixos-rebuild-remote-fish branch October 11, 2019 11:26
@edolstra
Copy link
Member

Isn't FOO=bar command allowed by POSIX?

@edolstra
Copy link
Member

Also, why are we even messing with PATH? It seems less error-prone to call $remoteNix directly.

@jtojnar
Copy link
Member Author

jtojnar commented Oct 11, 2019

Fish is not POSIX-compatible.

Is there any requirement that ssh must use a POSIX shell for non-interactive cases? In that case we should probably fix users.defaultUserShell.

Calling $remoteNix/nix-copy-closure directly might work but it would require much wider rewrite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants