From 43d11337723ce56800779774513b8b30a1bf51c4 Mon Sep 17 00:00:00 2001 From: clerie Date: Mon, 30 Jun 2025 18:35:57 +0200 Subject: [PATCH 1/2] modules/clerie-system-upgrade: Always reboot after an update --- hosts/dn42-il-gw1/configuration.nix | 1 - hosts/dn42-il-gw5/configuration.nix | 1 - hosts/dn42-il-gw6/configuration.nix | 1 - hosts/dn42-ildix-clerie/configuration.nix | 1 - hosts/dn42-ildix-service/configuration.nix | 1 - hosts/nonat/configuration.nix | 1 - hosts/storage-2/configuration.nix | 1 - modules/clerie-system-upgrade/default.nix | 7 +------ .../clerie-system-upgrade/clerie-system-upgrade.sh | 14 ++------------ 9 files changed, 3 insertions(+), 25 deletions(-) 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" From d9a76702aa9111bd29e9a41dafa30b832ab24e75 Mon Sep 17 00:00:00 2001 From: Flake Update Bot Date: Tue, 1 Jul 2025 03:03:06 +0200 Subject: [PATCH 2/2] Update nixpkgs 2025-07-01-01-03 --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 87097b8..28f830d 100644 --- a/flake.lock +++ b/flake.lock @@ -646,11 +646,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1750776420, - "narHash": "sha256-/CG+w0o0oJ5itVklOoLbdn2dGB0wbZVOoDm4np6w09A=", + "lastModified": 1751011381, + "narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "30a61f056ac492e3b7cdcb69c1e6abdcf00e39cf", + "rev": "30e2e2857ba47844aa71991daa6ed1fc678bcbb7", "type": "github" }, "original": {