summary refs log tree commit diff
path: root/ripple/website/serve.nix
diff options
context:
space:
mode:
authorV <v@unfathomable.blue>2021-02-25 21:17:45 +0100
committerV <v@unfathomable.blue>2021-02-25 21:55:23 +0100
commitf5c8a8537a336b60fd28af003572fa8883fc8354 (patch)
tree7374f969bae7709fa78388a0dc288f926ade1f3b /ripple/website/serve.nix
parent2f487c3bf7cd8efd64f1d217edac732db98ff1c0 (diff)
ripple/website: init
This contains the source to Ripple's website, as it was published on
2020-10-07.

Change-Id: I4c871be79d8841b277d23ea741c8728ec5da8cc8
Diffstat (limited to 'ripple/website/serve.nix')
-rw-r--r--ripple/website/serve.nix25
1 files changed, 25 insertions, 0 deletions
diff --git a/ripple/website/serve.nix b/ripple/website/serve.nix
new file mode 100644
index 0000000..476b0b7
--- /dev/null
+++ b/ripple/website/serve.nix
@@ -0,0 +1,25 @@
+let
+  pkgs = import <nixpkgs> {};
+  config = builtins.toFile "Caddyfile" ''
+    {
+      admin off
+    }
+
+    :8080
+
+    try_files {path}.html {path}
+    file_server {
+      root result
+    }
+
+    handle_errors {
+      respond "{http.error.status_code} {http.error.status_text}"
+    }
+
+    log {
+      format single_field common_log
+    }
+  '';
+in pkgs.mkShell {
+  shellHook = "exec ${pkgs.caddy}/bin/caddy run --adapter caddyfile --config ${config}";
+}