From a333c097c87c8b450bcdeb8bbccbd254db958a72 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Wed, 15 Oct 2025 10:21:00 -0400 Subject: cron->timer-update-timestamps --- modules/git/timer-backup.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 modules/git/timer-backup.nix (limited to 'modules/git/timer-backup.nix') diff --git a/modules/git/timer-backup.nix b/modules/git/timer-backup.nix new file mode 100644 index 0000000..42c227d --- /dev/null +++ b/modules/git/timer-backup.nix @@ -0,0 +1,26 @@ +{ config, lib, pkgs, ... }: + +{ + systemd.timers."backup-repositories" = { + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily"; + Persistent = true; + Unit = "backup-repositories.service"; + }; + }; + + systemd.services."backup-repositories" = { + script = '' + mkdir -p $HOME/backups + + REPOSITORIES=$(find /home/git/* -name '*.git' -type d) + + ''; + + serviceConfig = { + Type = "oneshot"; + User = "git"; + }; + }; +} -- cgit v1.2.3