about summary refs log tree commit diff
path: root/ops/nixos/www/cs.tvl.fyi.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-07-12T11·54+0100
committertazjin <mail@tazj.in>2020-07-12T13·36+0000
commit93575158c64e3400860a8f99b534f84b71ed68a6 (patch)
tree506c53a386b2a19472d3572897a5fa2ce2b08232 /ops/nixos/www/cs.tvl.fyi.nix
parent6ed4e7d4d12cc15777d3f05e04ff240df3986d8e (diff)
feat(whitby): Enable SourceGraph server r/1262
Change-Id: Ia8a20d54a4ac77d64f5e3fd2255ffad78dce0fb0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1067
Tested-by: BuildkiteCI
Reviewed-by: lukegb <lukegb@tvl.fyi>
Diffstat (limited to 'ops/nixos/www/cs.tvl.fyi.nix')
-rw-r--r--ops/nixos/www/cs.tvl.fyi.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/ops/nixos/www/cs.tvl.fyi.nix b/ops/nixos/www/cs.tvl.fyi.nix
new file mode 100644
index 000000000000..ed2adcbf8294
--- /dev/null
+++ b/ops/nixos/www/cs.tvl.fyi.nix
@@ -0,0 +1,30 @@
+{ config, ... }:
+
+{
+  imports = [
+    ./base.nix
+  ];
+
+  config = {
+    services.nginx.virtualHosts."cs.tvl.fyi" = {
+      serverName = "cs.tvl.fyi";
+      enableACME = true;
+      forceSSL = true;
+
+      extraConfig = ''
+        location = / {
+          return 301 https://cs.tvl.fyi/depot;
+        }
+
+        location / {
+          proxy_set_header X-Sg-Auth "Anonymous";
+          proxy_pass http://localhost:${toString config.services.depot.sourcegraph.port};
+        }
+
+        location /users/Anonymous/settings {
+          return 301 https://cs.tvl.fyi;
+        }
+      '';
+    };
+  };
+}