summaryrefslogtreecommitdiff
path: root/modules/nixos/traits/auto-upgrade.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/traits/auto-upgrade.nix')
-rw-r--r--modules/nixos/traits/auto-upgrade.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/nixos/traits/auto-upgrade.nix b/modules/nixos/traits/auto-upgrade.nix
new file mode 100644
index 0000000..bdb919c
--- /dev/null
+++ b/modules/nixos/traits/auto-upgrade.nix
@@ -0,0 +1,29 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.traits.autoUpgrade;
+in {
+ options.traits.autoUpgrade = {
+ enable = lib.mkEnableOption "automatic updates";
+ };
+
+ config = lib.mkIf cfg.enable {
+ system.autoUpgrade = {
+ enable = true;
+
+ /*
+ a workflow updates the flake every 24h at ~0:00UTC/8:00EST;
+ most devices of mine will be in EST currently. this could probably be
+ "01:00" or "daily" but i think that's a bit of a risk if i ever change/
+ dont set the time zone for a device and forget about this lol
+ */
+ dates = lib.mkDefault "02:00";
+ flake = "github:getchoo/flake#${config.networking.hostName}";
+ flags = [
+ "--refresh"
+ ];
+ };
+ };
+}