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:
@@ -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.
|
||||
@@ -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