From 438bb4b8a7d28695c48f742575c13a15cfc6ae3c Mon Sep 17 00:00:00 2001 From: Anish L Date: Tue, 14 Jun 2022 23:27:01 +1000 Subject: [PATCH] fix: kitaab sync --- profiles/sync/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/profiles/sync/default.nix b/profiles/sync/default.nix index a689e571..7a3da959 100644 --- a/profiles/sync/default.nix +++ b/profiles/sync/default.nix @@ -5,16 +5,22 @@ serviceConfig.Type = "oneshot"; path = [ pkgs.git + pkgs.coreutils ]; script = '' - ${pkgs.coreutils}/bin/cd /home/anish/kitaab/vimwiki - ${pkgs.git} commit -am "syncing curve" - ${pkgs.git} push + cd /home/anish/kitaab + git add -A + git diff-index --quiet HEAD || git commit -m 'syncing kitaab' # if nothing, don't exit 1 + git push + exit 0 ''; + serviceConfig = { + User = "anish"; + }; }; systemd.timers.kitaab-timer = { wantedBy = [ "timers.target" ]; partOf = [ "kitaab-sync.service" ]; - timerConfig.OnCalendar = [ "*-*-* *:00:00" ]; + timerConfig.OnCalendar = [ "daily" ]; }; }