mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 09:14:24 +01:00
caddy: Configure virtual hosts inside each web-service's module instead of in the host configs
This commit is contained in:
parent
dfeb11dfbd
commit
c9f05a040e
23 changed files with 130 additions and 170 deletions
|
|
@ -14,23 +14,11 @@ in
|
|||
type = lib.types.nonEmptyStr;
|
||||
default = "";
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.port;
|
||||
default = 8787;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
meta = {
|
||||
domains.list = [ cfg.domain ];
|
||||
ports.tcp.list = [ cfg.port ];
|
||||
};
|
||||
meta.domains.list = [ cfg.domain ];
|
||||
|
||||
services.static-web-server = {
|
||||
enable = true;
|
||||
listen = "[::]:${toString cfg.port}";
|
||||
root = "${pkgs.it-tools}/lib";
|
||||
configuration.general.health = true;
|
||||
};
|
||||
custom.services.caddy.virtualHosts.${cfg.domain}.files = "${pkgs.it-tools}/lib";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue