Since 18.09 now forces people to update their Nix version to 2.0 (see https://github.com/NixOS/nixpkgs/pull/45779), only people running a 18.03 system will actually be able to smoothly upgrade with the default update procedure (upgrade channel, nixos-rebuild). Reason being that in versions <=17.09 the default Nix daemon version is <2.0, which means that even if you install a Nix 2.0 client, it won't succeed due to the daemon/client mismatch (see https://github.com/NixOS/nixpkgs/issues/42319).
Preferably both of those
In my opinion we should revert the 2.0 forcing anyways, there's just too many problems with 2.0 yet to be addressed. There's been already 2 people in IRC with super annoying Nix upgrade process bugs since the bump 2 weeks ago.
Ping @samueldr @vcunat @grahamc @lheckemann @symphorien @ElvishJerricco
IMHO:
Boot into the installer and call nixos-install
is the right solution. Low fuss and high reliability.
Doesn't nixos-rebuild build nix first and use that to evaluate/build the rest of the system for this exact reason?
EDIT:
@LnL7 Not sure how that's supposed to work, because importing nixpkgs will fail in any case with a Nix version <2.0, because of the check in <nixpkgs/default.nix>. nixos-rebuild should have the same problem.
Now, the build-time closure of nix itself probably won't use placeholders yet, so the abortion itself would be the only blocker (as only new nix gets built and then it's used for further evaluation), but I can't see how to easily enforce this [...]
Yeah, it works slightly differently then I expected. I thought only nix itself would rebuild or substitute using the fallback paths.
If fallback was to be used/preferred, you wouldn't be able to use a custom nix for your nixos (for the OS evaluation step at least).
Yes, the fallback paths should be used as a fallback. 馃槃
As far as I recall, it is also not possible to upgrade to 18.03 from 17.03 without going though 17.09 first, since the Nix 1.11 in 17.03 is too old to evaluate 18.03, so this isn't a completely unusual situation.
I do agree that it's nice to facilitate a good upgrade path for people who still use unsupported versions of NixOS.
I just booted up a 17.03 VM and ran:
$ nixos-rebuild boot -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-18.03.tar.gz
And it worked just fine. I believe it evaluated the nix package from the 18.03 nixpkgs and used that to evaluate the system configuration.
Maybe we could allow to just evaluate the nix package from nixpkgs and have a test that we do not use nix 2.0 features for its dependencies yet?
I was on an old 18.03 system with Nix 1.11. I browsed around Hydra to find the latest Nix build from the nixos-unstable channel, and ran
nix-store -r /nix/store/sm740vh74gh7r8ww6q3wf067xkq1nb64-nix-2.3.1
sudo PATH="/nix/store/sm740vh74gh7r8ww6q3wf067xkq1nb64-nix-2.3.1/bin:$PATH" _NIXOS_REBUILD_REEXEC=1 nixos-rebuild boot
Maybe nixos-rebuild --with-nix=<path> should be an option.
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
While this is theoretically still an issue, nobody is using those versions anymore. The problem might occur again in the future though.