mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-05-13 15:51:09 +02:00
caddy: make a shared module
This commit is contained in:
parent
ff44839229
commit
f511f7d146
6 changed files with 53 additions and 42 deletions
|
@ -17,22 +17,6 @@ let
|
|||
in
|
||||
{
|
||||
services.caddy = {
|
||||
enable = true;
|
||||
email = "ca@${config.networking.domain}";
|
||||
logFormat = "format console";
|
||||
globalConfig = ''
|
||||
servers {
|
||||
metrics
|
||||
}
|
||||
'';
|
||||
virtualHosts.":2018" = {
|
||||
extraConfig = ''
|
||||
metrics
|
||||
'';
|
||||
logFormat = ''
|
||||
output discard
|
||||
'';
|
||||
};
|
||||
virtualHosts."${config.networking.domain}".extraConfig = ''
|
||||
file_server browse
|
||||
root * /srv/web/${config.networking.domain}
|
||||
|
@ -40,7 +24,4 @@ in
|
|||
respond /.well-known/matrix/server ${builtins.toJSON serverConfig}
|
||||
'';
|
||||
};
|
||||
systemd.services.caddy.environment.XDG_DATA_HOME = "/var/lib";
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 2018 ];
|
||||
networking.firewall.allowedUDPPorts = [ 443 ];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue