lilyball / nix-env.fish

Nix environment setup for the fish shell
The Unlicense
278 stars 15 forks source link

breaks on fish 3.3.0 #8

Closed maparent closed 3 years ago

maparent commented 3 years ago

I get this error message:


set: Did you mean 'set PATH $PATH <....my whole path...>'?```
(the whole path is in semicolon form).
Latest nix-env installed from fisher 4.3.0, fish 3.3.0 from homebrew on MacOS 11.4
golddranks commented 3 years ago

I can confirm this, just got the same error message after doing a brew upgrade.

lilyball commented 3 years ago

This script doesn't touch PATH directly, it instead runs set -xg (string split -m 1 = $line), so I'm going to say this is a Fish bug, it should only complain about a literal reference to PATH.

Unfortunately, I can't make any commits at the moment, but in nixpkgs 21.05 and later the fish derivation has a new overridable parameter fishEnvPreInit that exists to let you hook into the early fish startup and let you source scripts at the place where the nixpkgs fish setup normally sources /etc/fish/nixos-env-preinit.fish. Which is to say, you can set up your nix env vars (by sourcing nix-daemon.sh) early enough that Fish does all of the initialization the way it works on NixOS (setting up function/completion paths, sourcing conf.d files, etc). And it supports sourcing bash scripts too. See the source for details. The only catch is overriding this requires recompiling fish, which isn't a big deal but is a lot slower than downloading the prebuilt binary.

lilyball commented 3 years ago

I've filed https://github.com/fish-shell/fish-shell/issues/8095. Hopefully this gets dealt with quickly.

jskswamy commented 3 years ago

@lilyball fish has released a newer version 3.3.1 with the fix for fish-shell/fish-shell#8095

gustavoavena commented 3 years ago

Just upgraded fish to 3.3.1 and it seems like nix-env is working again (as before v3.3.0) 🙂

Memphizzz commented 3 years ago

I came here to report the same thing. Upgrading to fish 3.3.1 solved the problem. This issue can be closed.