nix-conf/modules/services/repo-sync/default.nix

27 lines
627 B
Nix
Raw Normal View History

2023-08-23 21:37:00 +02:00
{ pkgs, ... }:
{
systemd.timers."repo-sync" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "15m";
Unit = "repo-sync.service";
};
};
systemd.services."repo-sync" = {
script = ''
${pkgs.git}/bin/git -C /var/lib/repo-sync pull -r codeberg
${pkgs.git}/bin/git -C /var/lib/repo-sync pull -r github
${pkgs.git}/bin/git -C /var/lib/repo-sync pull -r gitlab
2023-08-23 21:37:00 +02:00
${pkgs.git}/bin/git -C /var/lib/repo-sync push origin
'';
2023-08-23 21:47:18 +02:00
path = [pkgs.openssh];
2023-08-23 21:37:00 +02:00
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
2023-08-23 21:38:05 +02:00
}