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:
@@ -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",
|
||||
|
||||
@@ -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[@]}"
|
||||
|
||||
Reference in New Issue
Block a user