diff --git a/doc/manual/rl-next/fix-upgrade-nix.md b/doc/manual/rl-next/fix-upgrade-nix.md new file mode 100644 index 000000000..91f5f229f --- /dev/null +++ b/doc/manual/rl-next/fix-upgrade-nix.md @@ -0,0 +1,9 @@ +--- +synopsis: "Fix upgrade-nix breaking its own access to the daemon" +cls: [5504, 5567] +category: "Fixes" +issues: [fj#1189, fj#1207] +credits: [Qyriad] +--- + +`nix upgrade-nix`, and the helper script `misc/upgrade-lix.sh` now pass `--store local` to all Nix commands, so the upgrade process can make changes to the daemon without breaking further steps in the upgrade. diff --git a/lix/nix/upgrade-nix.cc b/lix/nix/upgrade-nix.cc index 6617b4818..cc3384f4a 100644 --- a/lix/nix/upgrade-nix.cc +++ b/lix/nix/upgrade-nix.cc @@ -141,6 +141,8 @@ struct CmdUpgradeNix : MixDryRun, EvalCommand // install the new one, in case the new and old versions aren't considered // to be "the same package" by nix-env's logic (e.g., if their pnames differ). Strings removeArgs = { + "--store", + "local", "--uninstall", oldNixEnv, "--profile", @@ -150,6 +152,8 @@ struct CmdUpgradeNix : MixDryRun, EvalCommand aio().blockOn(runProgram(newNixEnv, false, removeArgs)); Strings upgradeArgs = { + "--store", + "local", "--profile", this->profileDir, "--install", diff --git a/misc/upgrade-lix.sh b/misc/upgrade-lix.sh index 664e919ae..34689eed3 100755 --- a/misc/upgrade-lix.sh +++ b/misc/upgrade-lix.sh @@ -124,9 +124,12 @@ checkSystemdService set -x exec "$NIX" run \ + --store local \ --extra-experimental-features "nix-command flakes" \ "${SUBSTITUTER_ARGS[@]}" \ "${LIX_BASE}?ref=${LIX_REF}" \ + -- \ + --store local \ --extra-experimental-features "nix-command flakes" \ upgrade-nix \ "${SUBSTITUTER_ARGS[@]}"