1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 18:01:16 +02:00

nix-profile{,-daemon}.fish: fix do not source twice

Commit b36637c8f7 set
`__ETC_PROFILE_NIX_SOURCED` globally, but this is not enough to prevent
the script from being run again by child shells, because the
variable was not exported and thus not inherited by any child process.
Exporting the variable also agrees with the bash scripts.

Notably, the old behavior broke `nix develop -c fish` in some cases,
because the profile bin directory got prepended to the path, causing
binaries from the profile to override binareis from the devshell.
This commit is contained in:
Stefan Boca 2025-05-20 22:01:56 -07:00
parent f627b8c721
commit b9ed3ae36e
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View file

@ -3,7 +3,7 @@ if test -z "$HOME" || test -n "$__ETC_PROFILE_NIX_SOURCED"
exit
end
set --global __ETC_PROFILE_NIX_SOURCED 1
set --global --export __ETC_PROFILE_NIX_SOURCED 1
# Local helpers

View file

@ -3,7 +3,7 @@ if test -z "$HOME" || test -n "$__ETC_PROFILE_NIX_SOURCED"
exit
end
set --global __ETC_PROFILE_NIX_SOURCED 1
set --global --export __ETC_PROFILE_NIX_SOURCED 1
# Local helpers