mirror of
https://codeberg.org/jopejoe1/nix-conf.git
synced 2025-01-04 08:26:54 +01:00
Clean up repo-sync script
This commit is contained in:
parent
66e309be8b
commit
9ee148f14e
1 changed files with 12 additions and 20 deletions
|
@ -18,27 +18,19 @@ in {
|
||||||
|
|
||||||
systemd.services."repo-sync" = {
|
systemd.services."repo-sync" = {
|
||||||
script = ''
|
script = ''
|
||||||
${
|
git clone git@codeberg.org:jopejoe1/nix-conf.git /var/lib/repo-sync
|
||||||
lib.getExe pkgs.git
|
git -C /var/lib/repo-sync remote add github git@github.com:jopejoe1/nix-conf.git
|
||||||
} clone git@codeberg.org:jopejoe1/nix-conf.git /var/lib/repo-sync
|
git -C /var/lib/repo-sync remote add gitlab git@gitlab.com:jopejoe1/nix-conf.git
|
||||||
${
|
git -C /var/lib/repo-sync pull -r github main
|
||||||
lib.getExe pkgs.git
|
git -C /var/lib/repo-sync pull -r gitlab main
|
||||||
} -C /var/lib/repo-sync remote add github git@github.com:jopejoe1/nix-conf.git
|
nix flake update /var/lib/repo-sync
|
||||||
${
|
git -C /var/lib/repo-sync commit -m "flack.lock updated on `$(date)`"
|
||||||
lib.getExe pkgs.git
|
git -C /var/lib/repo-sync push origin
|
||||||
} -C /var/lib/repo-sync remote add gitlab git@gitlab.com:jopejoe1/nix-conf.git
|
git -C /var/lib/repo-sync push github
|
||||||
${lib.getExe pkgs.git} -C /var/lib/repo-sync pull -r github main
|
git -C /var/lib/repo-sync push gitlab
|
||||||
${lib.getExe pkgs.git} -C /var/lib/repo-sync pull -r gitlab main
|
rm -r /var/lib/repo-sync
|
||||||
${lib.getExe pkgs.nix} flake update /var/lib/repo-sync
|
|
||||||
${
|
|
||||||
lib.getExe pkgs.git
|
|
||||||
} -C /var/lib/repo-sync commit -m "flack.lock updated on `$(${pkgs.coreutils}/bin/date)`"
|
|
||||||
${lib.getExe pkgs.git} -C /var/lib/repo-sync push origin
|
|
||||||
${lib.getExe pkgs.git} -C /var/lib/repo-sync push github
|
|
||||||
${lib.getExe pkgs.git} -C /var/lib/repo-sync push gitlab
|
|
||||||
${pkgs.coreutils}/bin/rm -r /var/lib/repo-sync
|
|
||||||
'';
|
'';
|
||||||
path = [ pkgs.openssh ];
|
path = [ pkgs.openssh pkgs.git pkgs.coreutils pkgs.nix ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = "root";
|
User = "root";
|
||||||
|
|
Loading…
Reference in a new issue