Fish port of ~/.nix-profile/etc/profile.d/nix.sh
which sets up Nix environment.
Differences from nix-env.fish
Nix.fish checks $PATH
for /nix/store/*
and respects $fish_user_paths
thus:
$PATH
is always set up correctlyconf.d
, function and completion scripts are loaded on the fly.
Nix.fish is pure fish, while nix-env.fish starts Bash to capture environment variables and hence slower.
Doesn't replicate __fish_build_paths.fish
__fish_build_paths.fish
handles vendored fish scripts from Nixpkgs. It's error-prone to replicate its logic when it is present.
If fish isn't installed from Nixpkgs, consider nix-env.fish
instead.