25 lines
No EOL
639 B
Nix
25 lines
No EOL
639 B
Nix
{ config, lib, ... }:
|
|
let
|
|
serviceConfig = import ../config/services.nix;
|
|
nginxModel = import ../intermediate/nginx.nix;
|
|
in
|
|
{
|
|
assertions = [
|
|
{
|
|
assertion = nginxModel.validatedEndpoints != [];
|
|
message = "No endpoints configured. Add endpoint declarations under config/endpoints/.";
|
|
}
|
|
];
|
|
|
|
services.nginx = {
|
|
enable = serviceConfig.nginx.enable;
|
|
|
|
recommendedProxySettings = true;
|
|
recommendedTlsSettings = true;
|
|
recommendedOptimisation = true;
|
|
recommendedGzipSettings = true;
|
|
streamConfig = nginxModel.streamConfig;
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = nginxModel.nginxUsedPorts;
|
|
} |