modules/nixfiles/nixfiles-system-upgrade.nix,modules/clerie-system-upgrade: rename module
This commit is contained in:
parent
b98fb3b061
commit
f011e3fc9e
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
clerie.nixfiles.enable = true;
|
clerie.nixfiles.enable = true;
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade.enable = true;
|
clerie.system-auto-upgrade.enable = true;
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings = {
|
||||||
trusted-users = [ "@wheel" "@guests" ];
|
trusted-users = [ "@wheel" "@guests" ];
|
||||||
|
@ -329,7 +329,7 @@
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
@ -183,7 +183,7 @@
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
startAt = "*-*-* 06:22:00";
|
startAt = "*-*-* 06:22:00";
|
||||||
|
@ -183,7 +183,7 @@
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
startAt = "*-*-* 07:22:00";
|
startAt = "*-*-* 07:22:00";
|
||||||
|
@ -62,7 +62,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
networking.firewall.allowedUDPPorts = [];
|
networking.firewall.allowedUDPPorts = [];
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||||
|
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
allowReboot = true;
|
allowReboot = true;
|
||||||
autoUpgrade = true;
|
autoUpgrade = true;
|
||||||
};
|
};
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.clerie.nixfiles.system-auto-upgrade;
|
cfg = config.clerie.system-auto-upgrade;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
clerie.nixfiles.system-auto-upgrade = {
|
clerie.system-auto-upgrade = {
|
||||||
enable = mkEnableOption "clerie nixfiles tools";
|
enable = mkEnableOption "clerie system upgrade";
|
||||||
allowReboot = mkOption {
|
allowReboot = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
@ -28,7 +28,7 @@ in
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
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
|
# Make sure this unit does not stop themself while upgrading
|
||||||
restartIfChanged = false;
|
restartIfChanged = false;
|
||||||
unitConfig.X-StopOnRemoval = 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"}";
|
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" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
|
OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
|
Loading…
Reference in New Issue
Block a user