From 9ee148f14e5953de40cb36c3e5ccc21527ade245 Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Sun, 31 Dec 2023 14:52:49 +0100 Subject: [PATCH] Clean up repo-sync script --- modules/repo-sync/default.nix | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/modules/repo-sync/default.nix b/modules/repo-sync/default.nix index cdf4598..483f07c 100644 --- a/modules/repo-sync/default.nix +++ b/modules/repo-sync/default.nix @@ -18,27 +18,19 @@ in { systemd.services."repo-sync" = { script = '' - ${ - lib.getExe pkgs.git - } clone git@codeberg.org:jopejoe1/nix-conf.git /var/lib/repo-sync - ${ - lib.getExe pkgs.git - } -C /var/lib/repo-sync remote add github git@github.com:jopejoe1/nix-conf.git - ${ - lib.getExe pkgs.git - } -C /var/lib/repo-sync remote add gitlab git@gitlab.com:jopejoe1/nix-conf.git - ${lib.getExe pkgs.git} -C /var/lib/repo-sync pull -r github main - ${lib.getExe pkgs.git} -C /var/lib/repo-sync pull -r gitlab main - ${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 + git clone git@codeberg.org:jopejoe1/nix-conf.git /var/lib/repo-sync + git -C /var/lib/repo-sync remote add github git@github.com:jopejoe1/nix-conf.git + 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 + git -C /var/lib/repo-sync pull -r gitlab main + nix flake update /var/lib/repo-sync + git -C /var/lib/repo-sync commit -m "flack.lock updated on `$(date)`" + git -C /var/lib/repo-sync push origin + git -C /var/lib/repo-sync push github + git -C /var/lib/repo-sync push gitlab + rm -r /var/lib/repo-sync ''; - path = [ pkgs.openssh ]; + path = [ pkgs.openssh pkgs.git pkgs.coreutils pkgs.nix ]; serviceConfig = { Type = "oneshot"; User = "root";