all repos — nixfiles @ 03ea3a1104ef88a15e57470e9f7651e5fea2a4d8

System and user configuration, managed by nix and home-manager

system/roles/go-vanity.nix (view raw)

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
{
  config,
  lib,
  ...
}:
let
  domain = config.networking.domain;
  oldDomain = "alanpearce.eu";
in
{
  services.caddy = {
    virtualHosts =
      let
        inherit (import ../../lib/caddy.nix { inherit lib; }) security-headers;
      in
      {
        "go.${domain}" = {
          extraConfig = ''
            encode zstd gzip
            ${security-headers { }}
            root * /srv/http/go.alin.ovh
            file_server
          '';
        };
        "go.${oldDomain}" = {
          extraConfig = ''
            encode zstd gzip
            ${security-headers { }}
            root * /srv/http/go
            file_server
          '';
        };
      };
  };
}