From f011e3fc9e9babf858aab4153d3458a98b48d70d Mon Sep 17 00:00:00 2001 From: clerie Date: Thu, 14 Mar 2024 20:30:37 +0100 Subject: [PATCH] modules/nixfiles/nixfiles-system-upgrade.nix,modules/clerie-system-upgrade: rename module --- configuration/common/nix.nix | 2 +- hosts/dn42-il-gw1/configuration.nix | 2 +- hosts/dn42-il-gw5/configuration.nix | 2 +- hosts/dn42-il-gw6/configuration.nix | 2 +- hosts/minecraft-2/configuration.nix | 2 +- hosts/nonat/configuration.nix | 2 +- hosts/storage-2/configuration.nix | 2 +- .../default.nix} | 10 +++++----- 8 files changed, 12 insertions(+), 12 deletions(-) rename modules/{nixfiles/nixfiles-system-upgrade.nix => clerie-system-upgrade/default.nix} (83%) diff --git a/configuration/common/nix.nix b/configuration/common/nix.nix index 75cc0a6..67977ec 100644 --- a/configuration/common/nix.nix +++ b/configuration/common/nix.nix @@ -4,7 +4,7 @@ clerie.nixfiles.enable = true; - clerie.nixfiles.system-auto-upgrade.enable = true; + clerie.system-auto-upgrade.enable = true; nix.settings = { trusted-users = [ "@wheel" "@guests" ]; diff --git a/hosts/dn42-il-gw1/configuration.nix b/hosts/dn42-il-gw1/configuration.nix index b984017..8ade80b 100644 --- a/hosts/dn42-il-gw1/configuration.nix +++ b/hosts/dn42-il-gw1/configuration.nix @@ -329,7 +329,7 @@ } ''; - clerie.nixfiles.system-auto-upgrade = { + 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 ac7a0d9..1512f88 100644 --- a/hosts/dn42-il-gw5/configuration.nix +++ b/hosts/dn42-il-gw5/configuration.nix @@ -183,7 +183,7 @@ } ''; - clerie.nixfiles.system-auto-upgrade = { + 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 ffefe9b..274f33a 100644 --- a/hosts/dn42-il-gw6/configuration.nix +++ b/hosts/dn42-il-gw6/configuration.nix @@ -183,7 +183,7 @@ } ''; - clerie.nixfiles.system-auto-upgrade = { + clerie.system-auto-upgrade = { allowReboot = true; autoUpgrade = true; startAt = "*-*-* 07:22:00"; diff --git a/hosts/minecraft-2/configuration.nix b/hosts/minecraft-2/configuration.nix index 3a893b0..611dc19 100644 --- a/hosts/minecraft-2/configuration.nix +++ b/hosts/minecraft-2/configuration.nix @@ -62,7 +62,7 @@ in { }; }; - clerie.nixfiles.system-auto-upgrade = { + clerie.system-auto-upgrade = { allowReboot = true; autoUpgrade = true; }; diff --git a/hosts/nonat/configuration.nix b/hosts/nonat/configuration.nix index d1af256..8e048bc 100644 --- a/hosts/nonat/configuration.nix +++ b/hosts/nonat/configuration.nix @@ -39,7 +39,7 @@ networking.firewall.allowedUDPPorts = []; - clerie.nixfiles.system-auto-upgrade = { + clerie.system-auto-upgrade = { allowReboot = true; autoUpgrade = true; }; diff --git a/hosts/storage-2/configuration.nix b/hosts/storage-2/configuration.nix index 3b39699..7631145 100644 --- a/hosts/storage-2/configuration.nix +++ b/hosts/storage-2/configuration.nix @@ -28,7 +28,7 @@ networking.firewall.allowedTCPPorts = [ 80 443 ]; - clerie.nixfiles.system-auto-upgrade = { + clerie.system-auto-upgrade = { allowReboot = true; autoUpgrade = true; }; diff --git a/modules/nixfiles/nixfiles-system-upgrade.nix b/modules/clerie-system-upgrade/default.nix similarity index 83% rename from modules/nixfiles/nixfiles-system-upgrade.nix rename to modules/clerie-system-upgrade/default.nix index 43e0612..6c3a212 100644 --- a/modules/nixfiles/nixfiles-system-upgrade.nix +++ b/modules/clerie-system-upgrade/default.nix @@ -3,13 +3,13 @@ with lib; let - cfg = config.clerie.nixfiles.system-auto-upgrade; + cfg = config.clerie.system-auto-upgrade; in { options = { - clerie.nixfiles.system-auto-upgrade = { - enable = mkEnableOption "clerie nixfiles tools"; + clerie.system-auto-upgrade = { + enable = mkEnableOption "clerie system upgrade"; allowReboot = mkOption { type = types.bool; default = false; @@ -28,7 +28,7 @@ in }; }; config = mkIf cfg.enable { - systemd.services.nixfiles-system-auto-upgrade = { + systemd.services.clerie-system-auto-upgrade = { # Make sure this unit does not stop themself while upgrading restartIfChanged = false; unitConfig.X-StopOnRemoval = false; @@ -38,7 +38,7 @@ in ExecStart = pkgs.nixfiles-system-upgrade + "/bin/nixfiles-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/nixfiles-system-upgrade.prom"}"; }; }; - systemd.timers.nixfiles-system-auto-upgrade = mkIf cfg.autoUpgrade { + systemd.timers.clerie-system-auto-upgrade = mkIf cfg.autoUpgrade { wantedBy = [ "timers.target" ]; timerConfig = { OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;