diff options
| author | seth <[email protected]> | 2024-02-08 23:54:12 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-09 01:17:16 -0500 |
| commit | c4e578e6ce2524b2ba5c45c1ab8b02063fb408f5 (patch) | |
| tree | cbba07e59304bd6f594935c777a05734fca4ba36 /modules/nixos/traits/auto-upgrade.nix | |
| parent | 36fc22ff3d454fd53094aaa5c22ed8bb365bc327 (diff) | |
traits/auto-upgrade: init
Diffstat (limited to 'modules/nixos/traits/auto-upgrade.nix')
| -rw-r--r-- | modules/nixos/traits/auto-upgrade.nix | 29 |
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" + ]; + }; + }; +} |
