fish: guard against growing PATH with nix
This commit is contained in:
parent
c1d02df5e8
commit
9f899167a7
@ -21,7 +21,13 @@ if test -f ~/.nix-profile/etc/profile.d/nix.sh
|
|||||||
for line in (bash -c 'source $0; for name in "${!NIX_@}"; do printf "%s=%s\n" "$name" "${!name}"; done' ~/.nix-profile/etc/profile.d/nix.sh)
|
for line in (bash -c 'source $0; for name in "${!NIX_@}"; do printf "%s=%s\n" "$name" "${!name}"; done' ~/.nix-profile/etc/profile.d/nix.sh)
|
||||||
set -gx (string split -m 1 = $line)
|
set -gx (string split -m 1 = $line)
|
||||||
end
|
end
|
||||||
set PATH ~/.nix-profile/bin $PATH 2>/dev/null
|
if functions -q fish_add_path
|
||||||
|
fish_add_path -gP ~/.nix-profile/bin
|
||||||
|
else
|
||||||
|
if not contains -- ~/.nix-profile/bin $PATH
|
||||||
|
set PATH ~/.nix-profile/bin $PATH 2>/dev/null
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Fish package manager
|
# Fish package manager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user