caddy: make a shared module

This commit is contained in:
Rouven Seifert 2025-05-09 14:23:57 +02:00
parent ff44839229
commit f511f7d146
Signed by: rouven.seifert
SSH key fingerprint: SHA256:WedRxwyCvqwDG6cd16qf/fizYDK1pvN4p5bawXlnKk0
6 changed files with 53 additions and 42 deletions

24
shared/caddy/default.nix Normal file
View file

@ -0,0 +1,24 @@
{ config, ... }:
{
services.caddy = {
enable = true;
email = "ca@${config.networking.domain}";
logFormat = "format console";
globalConfig = ''
servers {
metrics
}
'';
virtualHosts.":2018" = {
extraConfig = ''
metrics
'';
logFormat = ''
output discard
'';
};
};
systemd.services.caddy.environment.XDG_DATA_HOME = "/var/lib";
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 443 ];
}