summaryrefslogtreecommitdiff
path: root/nixos/modules/homelab/core/caddy.nix
blob: 5904388c08638c280e74fd2af4567345392a6be5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{config, lib, ...}: let
  cfg = config.homelab.core.caddy;
in {
  options.homelab.core.caddy = {
    enable = lib.mkEnableOption "caddy";
  };
  config = lib.mkIf cfg.enable {
    services.caddy = {
      enable = true;
      email = "culsans@vivaldi.net";
      virtualHosts = {
        "culsans.site".extraConfig = ''
          root * /srv/www/culsans.site
          file_server
        '';
      };
    };
    networking.firewall.allowedTCPPorts = [ 80 443 ];
  };
}