helm/profiles/sync/kitaab/default.nix

27 lines
552 B
Nix
Raw Permalink Normal View History

2022-03-24 06:06:10 -07:00
{ pkgs, ... }:
2021-11-29 04:11:58 -08:00
{
systemd.services.kitaab-sync = {
serviceConfig.Type = "oneshot";
path = [
2022-03-24 06:06:10 -07:00
pkgs.git
2022-06-14 06:27:01 -07:00
pkgs.coreutils
2022-03-24 06:06:10 -07:00
];
2021-11-29 04:11:58 -08:00
script = ''
2022-06-14 06:27:01 -07:00
cd /home/anish/kitaab
git add -A
git diff-index --quiet HEAD || git commit -m 'syncing kitaab' # if nothing, don't exit 1
git push
exit 0
2022-03-24 06:06:10 -07:00
'';
2022-06-14 06:27:01 -07:00
serviceConfig = {
User = "anish";
};
2021-11-29 04:11:58 -08:00
};
2022-06-22 06:14:35 -07:00
systemd.timers.kitaab-sync = {
2021-11-29 04:11:58 -08:00
wantedBy = [ "timers.target" ];
partOf = [ "kitaab-sync.service" ];
2022-07-10 21:20:41 -07:00
timerConfig.OnCalendar = [ "hourly" ];
2021-11-29 04:11:58 -08:00
};
}