about summary refs log tree commit diff
path: root/ops/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'ops/nixos')
-rw-r--r--ops/nixos/camden/default.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/ops/nixos/camden/default.nix b/ops/nixos/camden/default.nix
index e3bf8003ced6..8176df5c646b 100644
--- a/ops/nixos/camden/default.nix
+++ b/ops/nixos/camden/default.nix
@@ -149,6 +149,9 @@ in pkgs.lib.fix(self: {
     user = "nginx";
     group = "nginx";
     webroot = "/var/lib/acme/acme-challenge";
+    extraDomains = {
+      "git.camden.tazj.in" = null;
+    };
     postRun = "systemctl reload nginx";
   };
 
@@ -207,6 +210,24 @@ in pkgs.lib.fix(self: {
         }
       '';
     };
+
+    virtualHosts.cgit = {
+      serverName = "git.camden.tazj.in";
+      useACMEHost = "camden.tazj.in";
+      addSSL = 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/;
+        }
+      '';
+    };
   };
 
   system.stateVersion = "19.09";