about summary refs log tree commit diff
path: root/ops/modules/www
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-03-14T19·27+0300
committertazjin <tazjin@tvl.su>2023-03-14T22·10+0000
commit0965600fe6e3221cdb6a893fa52c46550fe7d4f0 (patch)
tree41e4ebb4b2f7c17f3e54205cc5d735772880f5e7 /ops/modules/www
parent231ed4c11e2dfb124d56138c39971ae02fcbc51a (diff)
feat(ops): serve Tvix website & docs on (docs.)tvix.dev r/6005
Change-Id: I198ea197867f9b9a48e51665d0665f722202e02e
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8299
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'ops/modules/www')
-rw-r--r--ops/modules/www/tvix.dev.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/ops/modules/www/tvix.dev.nix b/ops/modules/www/tvix.dev.nix
new file mode 100644
index 000000000000..f86f5b3b1e98
--- /dev/null
+++ b/ops/modules/www/tvix.dev.nix
@@ -0,0 +1,39 @@
+{ depot, ... }:
+
+{
+  imports = [
+    ./base.nix
+  ];
+
+  config = {
+    services.nginx.virtualHosts."tvix.dev" = {
+      serverName = "tvix.dev";
+      enableACME = true;
+      forceSSL = true;
+      root = depot.tvix.website;
+
+      extraConfig = ''
+        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
+      '';
+    };
+
+    services.nginx.virtualHosts."docs.tvix.dev" = {
+      serverName = "docs.tvix.dev";
+      enableACME = true;
+      forceSSL = true;
+
+      extraConfig = ''
+        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
+
+        location = / {
+          # until we have a better default page here
+          return 301 https://docs.tvix.dev/rust/tvix_eval/index.html;
+        }
+
+        location /rust/ {
+          alias ${depot.tvix.rust-docs}/;
+        }
+      '';
+    };
+  };
+}