mudrii@nixos ~ $ nix-env -u ''
mudrii@nixos ~ $ nix-channel --update nixos
unpacking channels...
mudrii@nixos ~ $ nix-env -u ''
warning: name collision in input Nix expressions, skipping '/home/mudrii/.nix-defexpr/channels_root/nixos'
From normal user run
nix-channel --update nixos
nix-env -u '*'
Please run nix-shell -p nix-info --run "nix-info -m"
and paste the
results.
mudrii@nixos ~ $ nix-shell -p nix-info --run "nix-info -m"
"x86_64-linux"
Linux 4.19.13, NixOS, 19.03pre165037.eebd1a92637 (Koi)
yes
yes
nix-env (Nix) 2.1.3
"nixos-19.03pre165037.eebd1a92637"
"nixos-19.03pre165037.eebd1a92637"
/nix/var/nix/profiles/per-user/root/channels/nixos
The solution was provided by @danbst on discourse.nixos.org
Seems nixos channel was added for non-root user, and nix-env doesn鈥檛 know which nixos channel to use - root or non-root.
The fix is to remove the nixos channel from non-root user fixes the problem.
user@nixos ~ $ nix-channel --remove nixos
Note: I don't remember adding any nixos channel to non-root user.
Is not exactly an issue but potential problem can be in not explicitly adding by normal user new channel why nix is showing an error.
Most helpful comment
The solution was provided by @danbst on discourse.nixos.org
Seems nixos channel was added for non-root user, and nix-env doesn鈥檛 know which nixos channel to use - root or non-root.
The fix is to remove the nixos channel from non-root user fixes the problem.
Note: I don't remember adding any nixos channel to non-root user.