1
0

Compare commits

..

3 Commits

Author SHA1 Message Date
Flake Update Bot
4473180060 Update from updated-inputs-2025-07-01-01-03 2025-07-01 03:03:08 +02:00
Flake Update Bot
d9a76702aa Update nixpkgs 2025-07-01-01-03 2025-07-01 03:03:06 +02:00
43d1133772 modules/clerie-system-upgrade: Always reboot after an update 2025-06-30 18:35:57 +02:00
9 changed files with 3 additions and 25 deletions

View File

@@ -238,7 +238,6 @@
}; };
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -112,7 +112,6 @@
}; };
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
startAt = "*-*-* 06:22:00"; startAt = "*-*-* 06:22:00";
}; };

View File

@@ -106,7 +106,6 @@
}; };
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
startAt = "*-*-* 07:22:00"; startAt = "*-*-* 07:22:00";
}; };

View File

@@ -162,7 +162,6 @@
''; '';
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -71,7 +71,6 @@
networking.firewall.allowedTCPPorts = [ 80 443 ]; networking.firewall.allowedTCPPorts = [ 80 443 ];
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -42,7 +42,6 @@
networking.firewall.allowedUDPPorts = []; networking.firewall.allowedUDPPorts = [];
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -53,7 +53,6 @@
}; };
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
allowReboot = true;
autoUpgrade = true; autoUpgrade = true;
}; };

View File

@@ -10,11 +10,6 @@ in
options = { options = {
clerie.system-auto-upgrade = { clerie.system-auto-upgrade = {
enable = mkEnableOption "clerie system upgrade"; enable = mkEnableOption "clerie system upgrade";
allowReboot = mkOption {
type = types.bool;
default = false;
description = "Monitor NixOS";
};
autoUpgrade = mkOption { autoUpgrade = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@@ -38,7 +33,7 @@ in
serviceConfig = { serviceConfig = {
Type = "oneshot"; 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 { systemd.timers.clerie-system-auto-upgrade = mkIf cfg.autoUpgrade {

View File

@@ -2,16 +2,11 @@
set -euo pipefail set -euo pipefail
ALLOW_REBOOT=
NO_CONFIRM= NO_CONFIRM=
NODE_EXPORTER_METRICS_PATH= NODE_EXPORTER_METRICS_PATH=
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--allow-reboot)
ALLOW_REBOOT=1
shift
;;
--no-confirm) --no-confirm)
NO_CONFIRM=1 NO_CONFIRM=1
shift shift
@@ -63,13 +58,8 @@ ACTIVATING_SYSTEM_KERNEL="$(readlink /nix/var/nix/profiles/system/{initrd,kernel
if [[ "$BOOTED_SYSTEM_KERNEL" != "$ACTIVATING_SYSTEM_KERNEL" ]]; then if [[ "$BOOTED_SYSTEM_KERNEL" != "$ACTIVATING_SYSTEM_KERNEL" ]]; then
echo "Reboot is required" echo "Reboot is required"
if [[ -n "$ALLOW_REBOOT" ]]; then echo "Rebooting system now"
echo "Rebooting system now" shutdown -r +1 "System update requires reboot"
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
else else
echo "No reboot is required" echo "No reboot is required"
echo "Activating system now" echo "Activating system now"