From ddef62574333d1fd8dfd0f85df7b3a3e71af945f Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Sun, 23 Aug 2026 11:09:19 -0400 Subject: cal.elmo.mou.fo service --- hostnix/elmo/cal.nix | 32 ++++++++++++++++++++++++++++++++ hostnix/elmo/configuration.nix | 1 + 2 files changed, 33 insertions(+) create mode 100644 hostnix/elmo/cal.nix diff --git a/hostnix/elmo/cal.nix b/hostnix/elmo/cal.nix new file mode 100644 index 0000000..64950a4 --- /dev/null +++ b/hostnix/elmo/cal.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: + +{ + systemd.tmpfiles.rules = [ + "d /opt/cal 0755 joe users" + ]; + + # TODO socket activation + systemd.services.cal = { + # Deno writes its module cache under $HOME, which DynamicUser does not give + # us; point it at /var/cache/cal instead. + # TODO node + environment.DENO_DIR = "/var/cache/cal"; + serviceConfig = { + Type = "exec"; + DynamicUser = true; + WorkingDirectory = "/opt/cal"; + StateDirectory = "cal"; + CacheDirectory = "cal"; + ExecStart = "${pkgs.deno}/bin/deno run --allow-net --allow-read --allow-write=/opt/cal/web/events,/opt/cal/web/_site web/server.ts"; + }; + }; + + # TODO allocate domain? + services.nginx.virtualHosts."cal.elmo.mou.fo" = { + useACMEHost = "elmo.mou.fo"; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:8000"; + }; + }; +} diff --git a/hostnix/elmo/configuration.nix b/hostnix/elmo/configuration.nix index 3835481..c53e4c3 100644 --- a/hostnix/elmo/configuration.nix +++ b/hostnix/elmo/configuration.nix @@ -5,6 +5,7 @@ ./acme.nix ./backup.nix ./bjj-booker.nix + ./cal.nix ./cgithub.nix ./clippersnip.nix ./dns.nix -- cgit v1.3.1