From c932240a83b0f990f0e6a3883ea5b728d5fa035b Mon Sep 17 00:00:00 2001 From: Anish L Date: Mon, 11 Jul 2022 16:54:02 +1000 Subject: [PATCH] add dhyan systemd service that requires dhyan to be pre-cloned --- profiles/dhyan/default.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 profiles/dhyan/default.nix diff --git a/profiles/dhyan/default.nix b/profiles/dhyan/default.nix new file mode 100644 index 00000000..460511b7 --- /dev/null +++ b/profiles/dhyan/default.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: + +{ + # TODO scrappy script that requires dhyan be cloned to /home/anish/usr/dhyan + # dhyan needs secrets, and internet access to run, havent figured that out with nix yet + systemd.services.dhyan = { + serviceConfig.Type = "oneshot"; + path = [ + pkgs.babashka + pkgs.jdk11 + ]; + script = '' + cd /home/anish/usr/dhyan + source .envrc + bb -m dhyan.main + ''; + serviceConfig = { + User = "anish"; + }; + }; + systemd.timers.dhyan = { + wantedBy = [ "timers.target" ]; + partOf = [ "kitaab-sync.service" ]; + timerConfig.OnCalendar = [ "daily" ]; + startAt = "*08:00:00"; + }; +}