You've run the installer but when you run any Nix command, like nix --version
, and Nix isn't found:
$ nix --version
bash: nix: command not found
Nix isn't currently on your PATH
.
-
Initialize your Nix profile:
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
This script sets up various environment variables that Nix needs to work. The installer does prompt you to run this command when it's finished with installation but it's easy to miss or forget.
-
Ensure that you're not overriding your existing
PATH
somewhere. If you have abash_profile
,zshrc
, or other file that modifies yourPATH
, make sure that it appends to yourPATH
rather than setting it directly.# Do this ✅ PATH=$PATH${PATH:+:}path1:path2:path3 # Not this ❌ PATH=path1:path2:path3