mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-04 09:06:53 +01:00
add repo syncer
This commit is contained in:
parent
a4c96a3a95
commit
980295c744
2 changed files with 26 additions and 0 deletions
|
@ -53,6 +53,7 @@
|
||||||
./modules/asf
|
./modules/asf
|
||||||
./modules/minecraft-server
|
./modules/minecraft-server
|
||||||
./modules/editor
|
./modules/editor
|
||||||
|
./modules/services/repo-sync
|
||||||
./modules/users/jopejoe1
|
./modules/users/jopejoe1
|
||||||
./modules/users/root
|
./modules/users/root
|
||||||
./overlays
|
./overlays
|
||||||
|
|
25
modules/services/repo-sync/default.nix
Normal file
25
modules/services/repo-sync/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ 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
|
Loading…
Reference in a new issue