I deleted /nix and started a fresh install of nix, however after installing nix install nix (MACBook Pro M1 arm64 BigSur) with sh <(curl -L https://nixos.org/nix/install)
I run $ nix
but I get the output zsh: command not found: nix
, same for nix-shell
also the /nix volume is not created, I also tried the instruction at https://docs.plutus-community.com/docs/setup/MacOS.html still same issue
Asked
Active
Viewed 6,947 times
13

Neo
- 717
- 2
- 11
- 26
1 Answers
27
Open
/etc/zshrc
and look for the following lines (probably at the end of the file):# 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
Copy these lines and delete them from this file.
Open
~/.zshrc
and add the above copied lines to the end of this fileReboot terminal and nix should work now.

lajosdeme
- 2,189
- 1
- 11
- 20
-
4I tried other solutions, and this is the only thing that worked for me. – james-see May 12 '22 at 16:17
-
1This also worked for me, but after I restarted my macbook everything turned back. And this time, I already put that code into .zshrc but still can't find nix cli. – ShuangSong Jul 25 '22 at 13:20
-
1It seems that upgrading macOS system will remove/reset the file `/etc/zshrc` that was updated by Nix during installation. – NeoZoom.lua Mar 23 '23 at 07:15