about summary refs log tree commit diff
path: root/ops/modules/www/tvix.dev.nix
blob: 33c0bb002c75cf221ec9e52e95fe2ab0d543554b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ 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."bolt.tvix.dev" = {
      root = depot.web.tvixbolt;
      enableACME = true;
      forceSSL = true;

      extraConfig = ''
        add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
      '';
    };

    # old domain, serve redirect
    services.nginx.virtualHosts."tvixbolt.tvl.su" = {
      enableACME = true;
      forceSSL = true;
      extraConfig = "return 301 https://bolt.tvix.dev$request_uri;";
    };

    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}/;
        }
      '';
    };
  };
}