Normally, one should be happy if there’s an upgrade, but for Nix I’ve come to absolutely dread doing major version upgrades. When writing new code, it’s often fine if the error messages are not that clear because you usually have some kind of correlation between what you last did and the error messages occurring. But for major upgrades, whenever there’s some incompatible change, you are shit out of luck. Latest example, the error message:
error: nixVersions.unstable has been removed. For bleeding edge (Nix master, roughly weekly updated) use nixVersions.git, otherwise use nixVersions.latest.
Ok, that is mentioned in the release notes, but why do I have this issue?
~/dotfiles master !2 ❯ grep -r nixVersions
~/dotfiles master !2 ❯
Fantastic, let’s see what --show-trace
says (I skip the part where I need to lookup again how to work around the cached failure because apparently people still think that is a good idea). Well, that’s just fantastic, lots of entries pointing to stuff in modules.nix
, attrsets.nix
and even aliases.nix
, which was close, but the error messages were useless. The whole trace is just nixpkgs and home-manager, not a single thing goes back to my config.
So I start searching for the error message and after a bit I can trace it down to this line in my config:
modules/systems/base.nix: package = pkgs.nixUnstable;
So why in the name of god can Nix show me hundreds of lines of traceback that are absolutely useless but not this line and say “HERE DUMMY, THIS IS NO LONGER ALLOWED, CHANGE IT”. And on an unrelated side note, when nixVersions.unstable
is no longer allowed, why is this alias still there in nixos-24.05:
pkgs/top-level/aliases.nix: nixUnstable = nixVersions.unstable; # Added 2022-01-26
I swear, the bigger my config gets and the more systems I add, the more of an issue all of this becomes. There’s no more happiness when NixOS releases new versions, it’s just the dread of fixing this kind of crap error while flying completely blind due to absolutely useless error messages and hoping that someone already encountered the issue and it was solved on Github.
Rant over.