diff --git a/hosts/dn42-il-gw1/configuration.nix b/hosts/dn42-il-gw1/configuration.nix index 0cd44a6..8328e3d 100644 --- a/hosts/dn42-il-gw1/configuration.nix +++ b/hosts/dn42-il-gw1/configuration.nix @@ -238,7 +238,6 @@ }; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; }; diff --git a/hosts/dn42-il-gw5/configuration.nix b/hosts/dn42-il-gw5/configuration.nix index ceef936..b232429 100644 --- a/hosts/dn42-il-gw5/configuration.nix +++ b/hosts/dn42-il-gw5/configuration.nix @@ -112,7 +112,6 @@ }; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; startAt = "*-*-* 06:22:00"; }; diff --git a/hosts/dn42-il-gw6/configuration.nix b/hosts/dn42-il-gw6/configuration.nix index e7b4dc3..6491bda 100644 --- a/hosts/dn42-il-gw6/configuration.nix +++ b/hosts/dn42-il-gw6/configuration.nix @@ -106,7 +106,6 @@ }; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; startAt = "*-*-* 07:22:00"; }; diff --git a/hosts/dn42-ildix-clerie/configuration.nix b/hosts/dn42-ildix-clerie/configuration.nix index 6022322..b6c4600 100644 --- a/hosts/dn42-ildix-clerie/configuration.nix +++ b/hosts/dn42-ildix-clerie/configuration.nix @@ -162,7 +162,6 @@ ''; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; }; diff --git a/hosts/dn42-ildix-service/configuration.nix b/hosts/dn42-ildix-service/configuration.nix index 6fe1d56..843da06 100644 --- a/hosts/dn42-ildix-service/configuration.nix +++ b/hosts/dn42-ildix-service/configuration.nix @@ -71,7 +71,6 @@ networking.firewall.allowedTCPPorts = [ 80 443 ]; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; }; diff --git a/hosts/nonat/configuration.nix b/hosts/nonat/configuration.nix index dfee059..8d1e79f 100644 --- a/hosts/nonat/configuration.nix +++ b/hosts/nonat/configuration.nix @@ -42,7 +42,6 @@ networking.firewall.allowedUDPPorts = []; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; }; diff --git a/hosts/storage-2/configuration.nix b/hosts/storage-2/configuration.nix index bfa5e41..ade3ece 100644 --- a/hosts/storage-2/configuration.nix +++ b/hosts/storage-2/configuration.nix @@ -53,7 +53,6 @@ }; clerie.system-auto-upgrade = { - allowReboot = true; autoUpgrade = true; }; diff --git a/modules/clerie-system-upgrade/default.nix b/modules/clerie-system-upgrade/default.nix index 38eb1c1..d2e7a26 100644 --- a/modules/clerie-system-upgrade/default.nix +++ b/modules/clerie-system-upgrade/default.nix @@ -10,11 +10,6 @@ in options = { clerie.system-auto-upgrade = { enable = mkEnableOption "clerie system upgrade"; - allowReboot = mkOption { - type = types.bool; - default = false; - description = "Monitor NixOS"; - }; autoUpgrade = mkOption { type = types.bool; default = false; @@ -38,7 +33,7 @@ in serviceConfig = { Type = "oneshot"; - ExecStart = pkgs.clerie-system-upgrade + "/bin/clerie-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/clerie-system-upgrade.prom"}"; + ExecStart = pkgs.clerie-system-upgrade + "/bin/clerie-system-upgrade --no-confirm${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/clerie-system-upgrade.prom"}"; }; }; systemd.timers.clerie-system-auto-upgrade = mkIf cfg.autoUpgrade { diff --git a/pkgs/clerie-system-upgrade/clerie-system-upgrade.sh b/pkgs/clerie-system-upgrade/clerie-system-upgrade.sh index 7e2ad11..c5eee1b 100755 --- a/pkgs/clerie-system-upgrade/clerie-system-upgrade.sh +++ b/pkgs/clerie-system-upgrade/clerie-system-upgrade.sh @@ -2,16 +2,11 @@ set -euo pipefail -ALLOW_REBOOT= NO_CONFIRM= NODE_EXPORTER_METRICS_PATH= while [[ $# -gt 0 ]]; do case $1 in - --allow-reboot) - ALLOW_REBOOT=1 - shift - ;; --no-confirm) NO_CONFIRM=1 shift @@ -63,13 +58,8 @@ ACTIVATING_SYSTEM_KERNEL="$(readlink /nix/var/nix/profiles/system/{initrd,kernel if [[ "$BOOTED_SYSTEM_KERNEL" != "$ACTIVATING_SYSTEM_KERNEL" ]]; then echo "Reboot is required" - if [[ -n "$ALLOW_REBOOT" ]]; then - echo "Rebooting system now" - shutdown -r +1 "System update requires reboot" - else - echo "Automatic reboot not allowed (maybe use --allow-reboot next time)" - echo "The system upgrade is staged, please reboot manually soon" - fi + echo "Rebooting system now" + shutdown -r +1 "System update requires reboot" else echo "No reboot is required" echo "Activating system now"