Closed maparent closed 3 years ago
I can confirm this, just got the same error message after doing a brew upgrade.
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.
I've filed https://github.com/fish-shell/fish-shell/issues/8095. Hopefully this gets dealt with quickly.
@lilyball fish has released a newer version 3.3.1 with the fix for fish-shell/fish-shell#8095
Just upgraded fish to 3.3.1 and it seems like nix-env is working again (as before v3.3.0) 🙂
I came here to report the same thing. Upgrading to fish 3.3.1 solved the problem. This issue can be closed.
I get this error message: