nixos installation issue,'command not found: nix'

Solution 1:

  1. 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
    
  2. Copy these lines and delete them from this file.

  3. Open ~/.zshrc and add the above copied lines to the end of this file

  4. Reboot terminal and nix should work now.