caddy: Configure virtual hosts inside each web-service's module instead of in the host configs

This commit is contained in:
SebastianStork 2025-11-08 22:52:01 +01:00
parent dfeb11dfbd
commit c9f05a040e
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
23 changed files with 130 additions and 170 deletions

View file

@ -133,9 +133,13 @@ in
};
custom = {
services.restic.backups.syncthing = lib.mkIf cfg.doBackups {
conflictingService = "syncthing.service";
paths = [ dataDir ];
services = {
caddy.virtualHosts.${cfg.gui.domain}.port = lib.mkIf (cfg.gui.domain != null) cfg.gui.port;
restic.backups.syncthing = lib.mkIf cfg.doBackups {
conflictingService = "syncthing.service";
paths = [ dataDir ];
};
};
persist.directories = [ dataDir ];