Hello everyone,
It appears that I have an older, imperatively installed Nix version that is taking precedence in my shell’s PATH, even though nix-darwin is managing my system.
Here are the details I’m observing:
1. Current which nix output:
My shell is picking up an older Nix executable:
› which nix
/Users/danielo/.nix-profile/bin/nix
2. nix doctor output (showing multiple Nix versions in PATH):
› nix doctor
warning: 'doctor' is a deprecated alias for 'config check'
[FAIL] Multiple versions of nix found in PATH:
"/nix/store/c6jdhw0wdfn21s0r5i3s1r6dcr61iimf-nix-2.30.2/bin"
"/nix/store/dfqs9x0l0r4dn7zjp1hymmv9wvpp9x2k-nix-2.26.2/bin"
"/nix/store/k6lw097k81nj40abgj6xzncvbrvbbx0y-nix-2.25.5/bin"
[PASS] All profiles are gcroots.
[PASS] Client protocol matches store protocol.
[INFO] You are trusted by store uri: daemon
3. Inspection of ~/.nix-profile/bin/nix:
The nix executable in my user’s profile is a symlink to an older store path:
› ls -l ~/.nix-profile/bin/nix
lrwxr-xr-x@ - root 1 Jan 1970 /Users/danielo/.nix-profile/bin/nix -> /nix/store/k6lw097k81nj40abgj6xzncvbrvbbx0y-nix-2.25.5/bin/nix*
4. Inspection of the ~/.nix-profile symlink:
The user profile symlink itself also points to a generic profile-4-link:
› ls -l ~/.nix-profile/
lrwxr-xr-x@ - danielo 26 Feb 11:14 /Users/danielo/.nix-profile -> profile-4-link
5. nix-env --query and nix profile list for my user:
These commands show no imperatively installed packages for my user:
› nix-env --query
# (No output)
› nix profile list
# (No output)
6. nix-env --query and nix profile list for root (using sudo):
When run with sudo, a different set of imperatively installed packages (Nix 2.26.2 and nss-cacert) are shown:
› sudo nix-env --query
warning: $HOME ('/Users/danielo') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
nix-2.26.2
nss-cacert-3.107
› sudo nix profile list
warning: $HOME ('/Users/danielo') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
Name: nix
Store paths: /nix/store/dfqs9x0l0r4dn7zjp1hymmv9wvpp9x2k-nix-2.26.2
Name: nss-cacert
Store paths: /nix/store/jpj7i429d6v44ca9k1xpgyfq3kq3ng8z-nss-cacert-3.107
7. Attempt to use Determinate Systems uninstaller:
An attempt to use a Determinate Systems uninstaller (if present) failed, indicating nix-darwin was detected:
› sudo /nix/nix-installer uninstall
nix-darwin installation detected, it must be removed before uninstalling Nix. Please refer to [https://github.com/LnL7/nix-darwin#uninstalling](https://github.com/LnL7/nix-darwin#uninstalling) for instructions how to uninstall `nix-darwin`.
What should I do to correctly configure my system so that nix-darwin fully manages the Nix installation and its version in the PATH? How do I remove the older imperative installations.
Thanks in advance!