From 63ff35710e2af51eb923d651eb56a5f5ebed55a6 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Thu, 1 Dec 2022 13:56:24 +1000 Subject: [PATCH] =?UTF-8?q?muneem=20is=20ready=20=F0=9F=99=87=F0=9F=8F=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.nix | 4 ++-- profiles/muneem/default.nix | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 profiles/muneem/default.nix diff --git a/flake.nix b/flake.nix index ec0da331..28b3bca2 100644 --- a/flake.nix +++ b/flake.nix @@ -148,9 +148,9 @@ }; suites = with profiles; rec { base = [ core users.root users.anish ]; - sealight = [ base server metrics gitea rss-bridge mount-mossnet ]; # matrix + sealight = [ base server metrics gitea rss-bridge mount-mossnet ]; lituus = [ base server metrics sealight-website matrix wireguard-server ]; - mossnet = [ base server taskd shaarli dns monitoring nfs gonic headphones radicale seafile syncthing dhyan calibre wallabag finance ]; # hpi sync.music + mossnet = [ base server taskd shaarli dns monitoring nfs gonic headphones radicale seafile syncthing dhyan calibre wallabag finance muneem ]; # hpi sync.music cube = [ base site server ]; graphical = [ base bluetooth music sync.kitaab sync.website sync.cal wifi desktop mimetypes ]; curve = [ graphical secrets syncthing ]; diff --git a/profiles/muneem/default.nix b/profiles/muneem/default.nix new file mode 100644 index 00000000..a82690ac --- /dev/null +++ b/profiles/muneem/default.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: + +{ + # TODO + # scrappy script that requires muneem be cloned to /home/anish/usr/muneem + # you also gotta setup .envrc and add all the secrets there lol + # muneem needs secrets, and internet access to install dependencies, havent figured that out with nix yet + # muneem also depends on jdk11, but that's only to install dependencies, run `bb -m dhyan.main` once before installing this script + # If you've updated muneem, you'll want to cd to /home/anish/usr/dhyan and run git pull + systemd.services.muneem = { + serviceConfig.Type = "oneshot"; + path = with pkgs; [ + babashka + git + jdk11 + curl + chromedriver + chromium + ]; + startAt = "Tue *03:00:00"; + script = '' + cd /home/anish/usr/muneem + source .envrc + bb -m muneem.main + ''; + serviceConfig = { + User = "anish"; + }; + }; + systemd.timers.muneem = { + wantedBy = [ "timers.target" ]; + partOf = [ "muneem.service" ]; + timerConfig.OnCalendar = [ "Tue *03:00:00" ]; + }; +}