I’m running both NixOS 24.05 and Debian 12.7 under WSL-2. On my Debian system I have nix version 2.24.6 but on my NixOS system I’m running 2.18.5. How can I get the version on NixOS to match that of my Debian system?
Hey. The newest nix
versions introduce a lot of problems and controversy. So much that nixpkgs
is holding back from updating the used nix
version. You can force NixOS to pull the latest nix
version with nix.package = pkgs.nixVersions.latest
in your configuration.
2.18.5 is the newest stable version of nix.
2.19+ has regressions, notably in performance and security.
So if you use 2.24.x, know that you are intentionally using an unstable version that may have issues on your system.
If it eventually stabilises well enough for NixOS, you will get that newest version automatically when you upgrade to 24.11 or whatever release it shows up in.
Many thanks for the information that was very helpful
(If these answers resolve your question, you should mark one of them as a solution so that this topic is marked as resolved.)