about summary refs log tree commit diff
path: root/ops/nixos/www/code.tvl.fyi.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-12T13·02+0100
committertazjin <mail@tazj.in>2020-07-12T13·36+0000
commit405b7ec95b8dd0c06caa0e4030760821aff370bc (patch)
tree9b7f226ac6653f950cdba4f1dfe558e548984d3d /ops/nixos/www/code.tvl.fyi.nix
parentd76f1eb10b6b280c2b52b947fa7b915b168bf593 (diff)
feat(whitby): Enable Gerrit & cgit deployments r/1264
Change-Id: Ic701552e130252cfff005938d9c4e98423a7a96a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1069
Reviewed-by: lukegb <lukegb@tvl.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-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/;
+        }
+      '';
+    };
+  };
+}