summaryrefslogtreecommitdiff
path: root/components/services/caddy.nix
blob: d3c674c6f4217475024787f851437e15fad8088c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{lib, config, ...}: {
  options.caddy.enable = lib.mkEnableOption "Caddy server";

  config = lib.mkIf config.caddy.enable {
    services.caddy = {
      enable = true;

      virtualHosts."leoflo.me".extraConfig = ''
        root /srv/leoflo.me/src
        templates
        file_server
      '';

      virtualHosts."files.leoflo.me".extraConfig = ''
        root /srv/files.leoflo.me
        file_server
      '';
    };
  };
}