I was using Win11 WSL-Ubuntu 22.04 inside powershell, I installed stand alone home-manager v24.05 using curl and used Nixpkgs v24.05 channel. I am NOT using flakes but simple home-manager with nixpkgs channels. Afterwards, I had to upgrade my channels to 25.05 so I used the following steps:
trace: warning: You are using
Home Manager version 25.05 and
Nixpkgs version 25.11.
Using mismatched versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of Home
Manager that corresponds with your chosen release of Nixpkgs.
If you insist then you can disable this warning by adding
home.enableNixpkgsReleaseCheck = false;
to your configuration.
I don’t understand why my nixpkgs is NOT 25.05. How can I ensure that my nixpkgs is at stable v25.05 in order to avoid the version mismatch warnings?
Firstly I’m kind of suspicious of this command. Is this really the recommended way to upgrade your Nix installation?
Can you run sudo nix-channel --list instead? IIRC the Nix daemon will only see the root-defined channels, and your commands seem to have been run as a user (I’m assuming due to the usage of $ in your snippet).
$ nix config show nix-path
says nixpkgs=flake:nixpkgs
on my WSL based machine with the problem.
On my other machine, LMDE6, I did an upgrade of nix and it went smooth but on this good machine the above command shows blank and the printenv NIX_PATH also returns blank
Thanks.
The file /etc/nix/nix.conf does NOT have nix-path entry but it has 2 similar entries: extra-nix-path = nixpkgs=flake:nixpkgs upgrade-nix-store-path-url = https://install.determinate.systems/nix-upgrade/stable/universal
I experimented with my local Ubuntu. It has the same entry and nothing else.
Just dropping the line will break nix path lookup completely.
My “nix on ubuntu” behaves completely different with nix-path completely being unset in the nix.conf.
The nix on Ubuntu was originally installed via the detsys installer though I am using a master built nix for everyday use.
Using the detsys installed 2.18, which still lingers for the daeom in the background gives me a sensible output for the nix path. Though a new one doesn’t.
So I did a very brief “bisection” on this issue:
❯ nix run nix/2.25.0 -- config show nix-path
nixpkgs=flake:nixpkgs
❯ nix run nix/2.22.0 -- config show nix-path
/home/nmelzer/.nix-defexpr/channels nixpkgs=flake:nixpkgs
❯ nix run nix/2.24.0 -- config show nix-path
nixpkgs=flake:nixpkgs
❯ nix run nix/2.23.0 -- config show nix-path
/home/nmelzer/.nix-defexpr/channels nixpkgs=flake:nixpkgs
Somewhen between 2.23 and 2.24 the mechanism changed. For now, the easiest fix I see is to manually add nix-path = /home/username/.nix-defexpr/channels to ~/.config/nix/nix.conf to make this work again and the system usable.
I sadly do not have the time for an indepth bisection, the time I have at this computer is limited.
Thanks.
Trick seems to have worked.
If Nix flakes is stable enough then would you recommend I move to nix flakes for my future Nix home-manager setups instead of Nix channels?