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

Tested in a Debian container.

Fixes #1189
Fixes https://git.lix.systems/lix-project/lix-installer/issues/79

Change-Id: Id7de28bf81eb122dd60755622b7816716a6a6964
This commit is contained in:
Qyriad
2026-04-24 15:56:19 +00:00
parent bb8bc31e58
commit de212be82b
2 changed files with 7 additions and 0 deletions
+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[@]}"