Avoid situtations where Apple updates "delete" nix from
PATH by adding nix to the PATH of user zsh and bash shells.
~/.zshenv, ~/.profile, ~/.bashrc, and ~/.bash_profile were chosen
to reflect the files that rustup also writes to.
Differential D6149
[Nix] Write Nix path to user shell files upon install • jon on Jan 3 2023, 10:39 AM. Authored by Tags None Referenced Files
Details Avoid situtations where Apple updates "delete" nix from ~/.zshenv, ~/.profile, ~/.bashrc, and ~/.bash_profile were chosen ./scripts/install_nix.sh # Should see it emit that it writes to ~/.zshenv # and potentionally others # Assert that it was written cat ~/.zshenv # Open new shell echo $PATH # Nix should have multiple paths if /etc/zshrc still sources Nix logic
Diff Detail
Event Timeline
Comment Actions I was just following what rustup does, as I assume they have had many years of refining what files need to be written to. Comment Actions This is really helpful context, would've been great to mention this at the start. Can you link to what you used as inspiration? Comment Actions During install: $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ... This path will then be added to your PATH environment variable by modifying the profile files located at: /Users/jon/.profile /Users/jon/.bash_profile /Users/jon/.bashrc /Users/jon/.zshenv Used the reset m1 to inspect what was written. Comment Actions
It was in the secondary paragraph of the summary.
|