upgrade-nix: use --store local, so we don't kill our own access to the daemon [backport]

Backported from https://gerrit.lix.systems/c/lix/+/5504,
to fix https://git.lix.systems/lix-project/lix/issues/1207

Change-Id: Id7de28bf81eb122dd60755622b7816716a6a6964
This commit is contained in:
Qyriad
2026-05-06 09:47:30 +00:00
parent fe0953923f
commit 247436669d
3 changed files with 16 additions and 0 deletions
+9
View File
@@ -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.
+4
View File
@@ -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",
+3
View File
@@ -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[@]}"