nix icon indicating copy to clipboard operation
nix copied to clipboard

Nix path doesn't add itself in zshrc

Open gyanaranjans opened this issue 1 year ago • 1 comments

Platform

  • [ ] Linux:
  • [x] macOS
  • [ ] WSL

Additional information

Nix is not in the path after i install nix even though /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh file exists

also Nix configuration is correctly added to the shell initialization files

cat /etc/zshrc /etc/bashrc /etc/bash.bashrc | grep 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'
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'
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'
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'

output

Priorities

Add :+1: to issues you find important.

gyanaranjans avatar Jun 22 '24 19:06 gyanaranjans

Nix not being on PATH generally points to your shell init files either hard-setting a PATH that doesn't include Nix after Nix's shell hook ran (often from one of the user-specific init files in ~/), or perhaps having an early return condition in the relevant init file that is keeping the shell hook from running at all.

If env | grep NIX shows a few variables, that's a good sign the shell hook is at least running and you can focus on looking for what might be overwriting PATH.

abathur avatar Jun 23 '24 16:06 abathur