diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-22 10:25:11 -0400 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-10-22 10:25:11 -0400 |
| commit | 00d0847d689db1e1054bcd82314c6db6a1c0690e (patch) | |
| tree | c2a9c9b482d287ae1dbaf6cb6f3c7ab67e126d84 /modules/timer-clean-backups.nix | |
| parent | 1d1481f05504764a71105271523e634c40cd792a (diff) | |
Diffstat (limited to 'modules/timer-clean-backups.nix')
| -rw-r--r-- | modules/timer-clean-backups.nix | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/modules/timer-clean-backups.nix b/modules/timer-clean-backups.nix new file mode 100644 index 0000000..208ac6f --- /dev/null +++ b/modules/timer-clean-backups.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + systemd.timers."clean-backups" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + Unit = "clean-backups.service"; + }; + }; + + systemd.services."clean-backups" = { + script = '' + find $HOME/backups -mtime 7 -delete + ''; + + serviceConfig = { + Type = "oneshot"; + User = "compromyse"; + }; + }; +} |
