DeterminateSystems / nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 2 million installs.
GNU Lesser General Public License v2.1
1.69k stars 46 forks source link

Multiple nix entries in PATH in bash #967

Open m0nhawk opened 2 weeks ago

m0nhawk commented 2 weeks ago

I noticed that PATH is being populated twice (with bash, running Fedora 40):

PATH

``` $ echo $PATH | tr ':' '\n' /home/user/.nix-profile/bin /nix/var/nix/profiles/default/bin /home/user/.local/bin /home/user/bin /home/user/.nix-profile/bin /nix/var/nix/profiles/default/bin /usr/local/bin /usr/local/sbin /usr/bin /usr/sbin ```


It's not a big issue, but it would be nice to have more control on the entries in PATH.

m0nhawk commented 2 weeks ago

For myself I settled on updating /etc/profile with this lines:

# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
    . '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix

And I am interested to help on making this more configurable - of course if it's of interest.