fish: support nix without fenv

This commit is contained in:
Charles Gould 2020-07-01 00:30:32 -04:00
parent 4c8f9160e0
commit 0098feea82

View File

@ -22,6 +22,14 @@ function ..; cd ..; end
function ...; cd ../..; end function ...; cd ../..; end
function ....; cd ../../..; end function ....; cd ../../..; end
# Nix package manager
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)
set -gx (string split -m 1 = $line)
end
set PATH ~/.nix-profile/bin $PATH 2>/dev/null
end
# Fish package manager # Fish package manager
set -g fisher_path ~/.config/fish/fisher set -g fisher_path ~/.config/fish/fisher
set fish_function_path $fish_function_path[1] $fisher_path/functions $fish_function_path[2..-1] set fish_function_path $fish_function_path[1] $fisher_path/functions $fish_function_path[2..-1]
@ -36,11 +44,6 @@ for file in $fisher_path/conf.d/*.fish
builtin source $file 2> /dev/null builtin source $file 2> /dev/null
end end
# Nix package manager
if test -f ~/.nix-profile/etc/profile.d/nix.sh
functions -q fenv && fenv source ~/.nix-profile/etc/profile.d/nix.sh
end
if status --is-interactive if status --is-interactive
# Disable the default shell greeting # Disable the default shell greeting
set fish_greeting set fish_greeting