28 lines
571 B
Nix
28 lines
571 B
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
systemd.services.kitaab-sync = {
|
|
serviceConfig.Type = "oneshot";
|
|
path = [
|
|
pkgs.git
|
|
pkgs.openssh
|
|
pkgs.coreutils
|
|
];
|
|
script = ''
|
|
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
|
|
'';
|
|
serviceConfig = {
|
|
User = "anish";
|
|
};
|
|
};
|
|
systemd.timers.kitaab-sync = {
|
|
wantedBy = [ "timers.target" ];
|
|
partOf = [ "kitaab-sync.service" ];
|
|
timerConfig.OnCalendar = [ "hourly" ];
|
|
};
|
|
}
|