lib/autoupdate: fix preventive measures
This commit is contained in:
parent
1a24cc1c5e
commit
5eb05b49e1
|
@ -16,7 +16,6 @@
|
||||||
# autoupdate-enabled. it is checked to prevent autoupdating back
|
# autoupdate-enabled. it is checked to prevent autoupdating back
|
||||||
# to a system without autoupdate when deploying with autoupdate
|
# to a system without autoupdate when deploying with autoupdate
|
||||||
# for the first time.
|
# for the first time.
|
||||||
environment.etc."autoupdated".text = "";
|
|
||||||
|
|
||||||
systemd.services.autoupdate = {
|
systemd.services.autoupdate = {
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
@ -34,11 +33,11 @@
|
||||||
echo "New system available: $NEW"
|
echo "New system available: $NEW"
|
||||||
# this should fetch the new system from the binary cache
|
# this should fetch the new system from the binary cache
|
||||||
nix build --no-link "$NEW"
|
nix build --no-link "$NEW"
|
||||||
if [ -e "$NEW/sw/etc/autoupdated" ]; then
|
if [ -e "$NEW/etc/systemd/system/autoupdate.timer" ]; then
|
||||||
# switch to the new system
|
# switch to the new system
|
||||||
"$NEW/bin/switch-to-configuration" switch
|
"$NEW/bin/switch-to-configuration" switch
|
||||||
else
|
else
|
||||||
echo "New system is not yet autoupdated"
|
echo "New system is not yet autoupdate-enabled. Refusing to switch into a dead end."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "No update required"
|
echo "No update required"
|
||||||
|
|
Loading…
Reference in New Issue