Hi,
I read the announcement of Nix 2.4 RC1 a couple of days ago and decided to give it a try today.
I’ll describe my experience with this here - not sure any of this qualifies as bugs, but the overall first impression upgrading from 2.3 was pretty bad for me tbh.
I’m on NixOS, firstly I had to spend a bit of time to figure out that the right package to use for this is:
nix.package = (import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/f7a1df955530f4e190db017c242b96d4abddf0a6.tar.gz") {}).nix_2_4;
It would be nice to include some instructions like this for NixOS users in future release candidate announcements.
After making that change and rebuilding, I try running nix run nixpkgs.jq
which shows this error:
error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
Error message isn’t great tbh… I look up the release notes and it says “The old nix run
has been renamed to nix shell
(and there is a new nix run
that does something else, as described above).”
Ok, that’s a bizarre decision I think, but fair enough at least it’s documented.
So I try nix shell nixpkgs.jq
but I get the exact same error “experimental Nix feature ‘nix-command’ is disabled”.
Release notes also mention “The nix
command is now marked as an experimental feature”. This is a bit unclear to me, I kinda had to guess that it was related to this in any way.
Anyway I define experimental-features = nix-command
in extraOptions
(again, it would be nice to include a short description on how to do this for NixOS).
I try nix shell nixpkgs.jq
again but I get a different error this time:
error: getting status of '/home/mauricio/nixpkgs.jq': No such file or directory
No idea what this is even trying to do now but it’s pretty clear that the release notes are incorrect saying that “‘nix run’ has been renamed to ‘nix shell’”.
Plus these error messages aren’t great tbh.
I’ll be going back to 2.3 for now.
I don’t usually expect this kind of breaking changes upgrading any software from version 2.3 to 2.4.
Also it just seems that there are undocumented breaking changes and people lose confidence in software when that happens.
I’m aware that 2.4 includes flakes now and the new way to do what I just wanted to do is nix run nixpkgs#jq
but currently the documentation / release notes / error messages just aren’t pointing users in the right direction I don’t think.
I just realised that this message is a bit long and has a rather negative feel to it so I’d like to finish by saying that I appreciate everyone’s hard work on Nix 2.4 and Nix/NixOS in general, I really do think that Nix is heading in the right direction with flakes and things are generally getting much better