From 9f899167a7b02e9de05a386e4ec87d307badf9b7 Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Sat, 11 Jul 2020 22:37:37 -0400 Subject: [PATCH] fish: guard against growing PATH with nix --- fish/config.fish | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fish/config.fish b/fish/config.fish index 0b17075..75b89c3 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -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) set -gx (string split -m 1 = $line) 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 # Fish package manager