When I try to run sudo nixos-rebuild switch --upgrade, I get the error:
error: evaluation aborted with the following error message: '
This version of Nixpkgs requires Nix >= 2.2, please upgrade:
- If you are running NixOS, `nixos-rebuild' can be used to upgrade your system.
But of course, the very command it’s asking me to run is the one which triggers that failure. So I’m not sure what to do here.
I’ve also tried sudo nix upgrade-nix but it says error: Nix on NixOS must be upgraded via 'nixos-rebuild'.
That’s a rolling channel, it can make those jumps in between, though if updated often enough that shouldn’t be a problem if updated regularly.
Perhaps you can use pinning techniques to get an older version of that channel that roughly is from the time of your last update, and then slowly advance it month by month.