The Nix manual says:
To use Nix, some environment variables should be set. In particular,
PATH should contain the directories
~/.nix-profile/bin. The first directory contains the Nix tools themselves, while
~/.nix-profile is a symbolic link to the current user environment
I’m assuming “prefix” means
/nix. I installed Nix and it works but my
$PATH doesn’t include
/nix/bin doesn’t even exist. Is this an error in the manual or am I not understanding it?
prefix is Autotools terminology¹. It refers to the path Nix was installed to. It will be something like
/nix/store/frsdhkhqd7fpzbmnzd9zmvq9klw20svm-nix-2.2.2. Though, we usually do not add
$PATH directly – instead, when we install Nix, it is symlinked to a profile (for example, under
~/.nix-profile/bin) and that is added to
nix executable is not found, try restarting the shell and check that
~/.nix-profile/bin is added to the PATH afterwards.
What I would do is make then change and then look at the new path. Assuming you’re using bash:
bash -lc "echo \$PATH"
This should act like a new login shell would, without losing your current shell (in case there are troubles).
It would probably be better to do something like
env -u PATH bash -lc 'echo $PATH' to ensure the bash subshell builds a new path from scratch.