mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-07 20:36:33 +01:00
26 lines
601 B
Nix
26 lines
601 B
Nix
|
{ 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 -r -C /var/lib/repo-sync pull codeberg
|
||
|
${pkgs.git}/bin/git -r -C /var/lib/repo-sync pull github
|
||
|
${pkgs.git}/bin/git -r -C /var/lib/repo-sync pull gitlab
|
||
|
${pkgs.git}/bin/git -C /var/lib/repo-sync push origin
|
||
|
'';
|
||
|
serviceConfig = {
|
||
|
Type = "oneshot";
|
||
|
User = "root";
|
||
|
};
|
||
|
};
|
||
|
}s
|