Compare commits
3 Commits
2bace31053
...
dbed794e8c
Author | SHA1 | Date | |
---|---|---|---|
|
dbed794e8c | ||
98de6489f3 | |||
d05f74ece9 |
@ -4,6 +4,8 @@
|
||||
|
||||
clerie.nixfiles.enable = true;
|
||||
|
||||
clerie.nixfiles.system-auto-upgrade.enable = true;
|
||||
|
||||
nix.settings = {
|
||||
trusted-users = [ "@wheel" "@guests" ];
|
||||
auto-optimise-store = true;
|
||||
|
@ -10,7 +10,6 @@
|
||||
colmena
|
||||
vim
|
||||
agenix
|
||||
nixfiles-system-upgrade
|
||||
];
|
||||
|
||||
programs.mtr.enable = true;
|
||||
|
@ -330,8 +330,8 @@
|
||||
'';
|
||||
|
||||
clerie.nixfiles.system-auto-upgrade = {
|
||||
enable = true;
|
||||
allowReboot = true;
|
||||
autoUpgrade = true;
|
||||
};
|
||||
|
||||
clerie.monitoring = {
|
||||
|
@ -184,8 +184,9 @@
|
||||
'';
|
||||
|
||||
clerie.nixfiles.system-auto-upgrade = {
|
||||
enable = true;
|
||||
allowReboot = true;
|
||||
autoUpgrade = true;
|
||||
startAt = "*-*-* 06:22:00";
|
||||
};
|
||||
|
||||
clerie.monitoring = {
|
||||
|
@ -184,8 +184,9 @@
|
||||
'';
|
||||
|
||||
clerie.nixfiles.system-auto-upgrade = {
|
||||
enable = true;
|
||||
allowReboot = true;
|
||||
autoUpgrade = true;
|
||||
startAt = "*-*-* 07:22:00";
|
||||
};
|
||||
|
||||
clerie.monitoring = {
|
||||
|
@ -40,8 +40,8 @@
|
||||
networking.firewall.allowedUDPPorts = [];
|
||||
|
||||
clerie.nixfiles.system-auto-upgrade = {
|
||||
enable = true;
|
||||
allowReboot = true;
|
||||
autoUpgrade = true;
|
||||
};
|
||||
|
||||
clerie.monitoring = {
|
||||
|
@ -15,6 +15,16 @@ in
|
||||
default = false;
|
||||
description = "Monitor NixOS";
|
||||
};
|
||||
autoUpgrade = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Automatically check and install upgrades";
|
||||
};
|
||||
startAt = mkOption {
|
||||
type = with types; nullOr string;
|
||||
default = null;
|
||||
description = "Systemd time string for starting the unit";
|
||||
};
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
@ -28,13 +38,16 @@ 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 = {
|
||||
systemd.timers.nixfiles-system-auto-upgrade = mkIf cfg.autoUpgrade {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 05:37:00";
|
||||
RandomizedDelaySec = "2h";
|
||||
OnCalendar = if cfg.startAt == null then "*-*-* 05:37:00" else cfg.startAt;
|
||||
RandomizedDelaySec = if cfg.startAt == null then "2h" else "10m";
|
||||
};
|
||||
after = [ "network-online.target" ];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
nixfiles-system-upgrade
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user