aboutsummaryrefslogtreecommitdiff
path: root/modules/services/nixos/mkCaddyCfg.nix
blob: bb2e06dee8917e7a8355d104b4952e50243d064a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
cfg: {
  services.caddy =
    if cfg.caddy.enable
    then {
      virtualHosts.${cfg.root_url}.extraConfig = ''
        ${
          if cfg.caddy.bind_tailscale
          then "bind tailscale/${cfg.service_name}"
          else ""
        }
        reverse_proxy ${cfg.bind_host}:${toString cfg.port}
      '';
    }
    else {};
}