-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
I have noticed that every once and a while /Users/andrewmckinlay/.nix-profile/bin
and /nix/var/nix/profiles/default/bin
disappear from my $PATH
. The last time this happened, the hook nix installed was missing from /etc/zshrc
.
Copying the following hook (copied from /etc/bashrc
) to /etc/zshrc
and restarting the shell fixed everything again:
# 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
My concern is that macOS updates will periodically overwrite /etc/.zshrc
(and /etc/.bashrc
), requiring effort on my part to reinstall nix. For example, one macOS update overwrote the entire file to fix this misspelling:
andrewmckinlay@imac ~ % diff /etc/zshrc.backup-before-nix /etc/zshrc
3c3
< # Setup user specific overrides for this in ~/.zhsrc. See zshbuiltins(1)
---
> # Setup user specific overrides for this in ~/.zshrc. See zshbuiltins(1)
Both files are read-only anyway, should they really be written to by the nix installer?
nathanshelly, tatey, kadimisetty, samuela, olirice and 81 morebbarker and yegorLitvinovrollchad