diff options
| author | Joe Mou <dev@mou.fo> | 2026-08-23 11:09:19 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-08-26 13:38:22 -0400 |
| commit | ddef62574333d1fd8dfd0f85df7b3a3e71af945f (patch) | |
| tree | f052b89e3caf6a1701ac4f4f4fe4d558744f51a7 /hostnix | |
| parent | 608fe9ccc6e7ea4ab1a458287261021dac1b742c (diff) | |
cal.elmo.mou.fo service
Diffstat (limited to 'hostnix')
| -rw-r--r-- | hostnix/elmo/cal.nix | 32 | ||||
| -rw-r--r-- | hostnix/elmo/configuration.nix | 1 |
2 files changed, 33 insertions, 0 deletions
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 |
