about summary refs log tree commit diff
path: root/ops/nixos/www/code.tvl.fyi.nix
diff options
context:
space:
mode:
Diffstat (limited to 'ops/nixos/www/code.tvl.fyi.nix')
-rw-r--r--ops/nixos/www/code.tvl.fyi.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/ops/nixos/www/code.tvl.fyi.nix b/ops/nixos/www/code.tvl.fyi.nix
new file mode 100644
index 0000000000..5ee33f39ca
--- /dev/null
+++ b/ops/nixos/www/code.tvl.fyi.nix
@@ -0,0 +1,27 @@
+{ config, ... }:
+
+{
+  imports = [
+    ./base.nix
+  ];
+
+  config = {
+    services.nginx.virtualHosts.cgit = {
+      serverName = "code.tvl.fyi";
+      enableACME = true;
+      forceSSL = true;
+
+      extraConfig = ''
+        # Static assets must always hit the root.
+        location ~ ^/(favicon\.ico|cgit\.(css|png))$ {
+           proxy_pass http://localhost:2448;
+        }
+
+        # Everything else hits the depot directly.
+        location / {
+            proxy_pass http://localhost:2448/cgit.cgi/depot/;
+        }
+      '';
+    };
+  };
+}