On a fresh installation with:
- macOs 12.4 (Monterey)
- Nix 2.9.1 release
- Nix-darwin unstable
- Flakes enabled
This is the result of nix doctor
:
$ nix doctor
[FAIL] Multiple versions of nix found in PATH:
/nix/store/cqdwb7khf6zg94bz7lnvfjqx6z775qaw-nix-2.9.1/bin
/nix/store/cxa1rp3zpqj9k0l0zgn7a0bbf31rhzbz-nix-2.9.0/bin
[PASS] All profiles are gcroots.
[PASS] Client protocol matches store protocol.
I guess this happened because I installed Nix v2.9.1 (https://releases.nixos.org/nix/nix-2.9.1/install) and then nix-darwin, but at that time nixpkgs were still pointing to Nix v2.9.0. Next, I’ve enabled the experimental flakes and noticed the issue.
I’m a newcomer and would like to understand the cause as much as the possible solutions. Note that I’m trying to do a fresh flakes-based installation of nix, nix-darwin, and home-manager but some channels inevitably came into play.
It’s very confusing to see Nix v2.9.1 as the actual version being used and reported, but not listed by nix-env
as installed nor even available.
$PATH
got messed up and must be cleaned, but I have no clue on what caused it.
Maybe $NIX_PATH
should also be simplified?
Please find below additional information that may be helpful for reasoning on this…
$ nix --version
nix (Nix) 2.9.1
$ nix-info -m
- system: `"x86_64-darwin"`
- host os: `Darwin 21.5.0, macOS 10.16`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.9.1`
- channels(root): `"nixpkgs"`
- channels(bob): `"darwin"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
$ sudo -i nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable
$ nix-channel --list
darwin https://github.com/LnL7/nix-darwin/archive/master.tar.gz
$ sudo -i nix-env -q
nix-2.9.1
nss-cacert-3.66
$ sudo -i nix-env -qasP nix
...
-PS nixpkgs.nixStable nix-2.9.0
-PS nixpkgs.nixFlakes nix-2.9.0
-PS nixpkgs.nixStatic nix-2.9.0
-PS nixpkgs.nix nix-2.9.0
$ nix-env -q
$ nix-env -qasP nix
...
-PS nixpkgs.nixStable nix-2.9.0
-PS nixpkgs.nixFlakes nix-2.9.0
-PS nixpkgs.nixStatic nix-2.9.0
-PS nixpkgs.nix nix-2.9.0
$ echo $NIX_PATH
darwin-config=/Users/bob/.nixpkgs/darwin-configuration.nix:/nix/var/nix/profiles/per-user/root/channels:/Users/bob/.nix-defexpr/channels
$ echo $PATH
/Users/bob/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/Users/bob/.nix-profile/bin:/run/current-system/sw/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin