diff --git a/fish/config.fish b/fish/config.fish index 57910a1..0f49a57 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -22,6 +22,14 @@ 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 set -g fisher_path ~/.config/fish/fisher 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 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 # Disable the default shell greeting set fish_greeting