diff --git a/scripts/nix-profile-daemon.fish.in b/scripts/nix-profile-daemon.fish.in index 1a20dffd245..e1758fbed9c 100644 --- a/scripts/nix-profile-daemon.fish.in +++ b/scripts/nix-profile-daemon.fish.in @@ -8,14 +8,9 @@ set --global --export __ETC_PROFILE_NIX_SOURCED 1 # Local helpers function add_path --argument-names new_path - if type -q fish_add_path - # fish 3.2.0 or newer - fish_add_path --prepend --global $new_path - else - # older versions of fish - if not contains $new_path $fish_user_paths - set --global fish_user_paths $new_path $fish_user_paths - end + # Directly manipulate PATH to avoid conflicts with user's fish_user_paths + if not contains $new_path $PATH + set --global --export --prepend PATH $new_path end end diff --git a/scripts/nix-profile.fish.in b/scripts/nix-profile.fish.in index abf716cec6f..b7676732c22 100644 --- a/scripts/nix-profile.fish.in +++ b/scripts/nix-profile.fish.in @@ -8,14 +8,9 @@ set --global --export __ETC_PROFILE_NIX_SOURCED 1 # Local helpers function add_path --argument-names new_path - if type -q fish_add_path - # fish 3.2.0 or newer - fish_add_path --prepend --global $new_path - else - # older versions of fish - if not contains $new_path $fish_user_paths - set --global fish_user_paths $new_path $fish_user_paths - end + # Directly manipulate PATH to avoid conflicts with user's fish_user_paths + if not contains $new_path $PATH + set --global --export --prepend PATH $new_path end end