summary refs log tree commit diff
path: root/fleet/hosts/trieste/web.nix
diff options
context:
space:
mode:
Diffstat (limited to 'fleet/hosts/trieste/web.nix')
-rw-r--r--fleet/hosts/trieste/web.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/fleet/hosts/trieste/web.nix b/fleet/hosts/trieste/web.nix
new file mode 100644
index 0000000..d32fc44
--- /dev/null
+++ b/fleet/hosts/trieste/web.nix
@@ -0,0 +1,32 @@
+# SPDX-FileCopyrightText: V <v@unfathomable.blue>
+# SPDX-License-Identifier: OSL-3.0
+
+{ pkgs, ... }:
+
+{
+  systemd.tmpfiles.rules = [
+    "d /var/lib/www - git git"
+  ];
+
+  declarative.git.repositories.ripple-website.hooks.post-receive = [
+    (pkgs.writeShellScript "update-ripple-website" ''
+      nix-build ${./build-from-git.nix} \
+        --argstr repo /var/lib/git/ripple-website \
+        -o /var/lib/www/ripple
+    '')
+  ];
+
+  services.caddy.config = ''
+    unfathomable.blue {
+      import common
+      respond / "the depths await"
+      error 404
+    }
+
+    ripple.unfathomable.blue {
+      import common
+      root * /var/lib/www/ripple
+      file_server
+    }
+  '';
+}