modules/autoupdate: always run nix-env before switch-to-configuration

This commit is contained in:
Astro 2022-09-02 21:26:14 +02:00
parent 8097c9a521
commit 5c493a8128
1 changed files with 2 additions and 0 deletions

View File

@ -41,6 +41,7 @@
nix copy --from https://hydra.hq.c3d2.de "$NEW"
if [ -e "$NEW/etc/systemd/system/autoupdate.timer" ]; then
echo "Switch to the new system..."
nix-env -p /nix/var/nix/profiles/system --set $NEW
"$NEW/bin/switch-to-configuration" switch
else
echo "New system is not yet autoupdate-enabled. Refusing to switch into a dead end."
@ -93,6 +94,7 @@
# this should fetch the new system from the binary cache
nix copy --from https://hydra.hq.c3d2.de "$NEW"
echo "Switch to the new system..."
nix-env -p /nix/var/nix/profiles/system --set $NEW
"$NEW/bin/switch-to-configuration" switch
else
echo "No update required"