nixos-conf/modules/services/utils/nginx-https-server.nix

34 lines
759 B
Nix
Raw Normal View History

{ config, lib, ... }:
let
2025-07-06 03:22:09 +03:00
cfg = config.custom.services.nginxHttpsServer;
in
{
options = {
2025-07-25 13:12:41 +03:00
custom.services.nginxHttpsServer.enable = lib.mkEnableOption "default nginx HTTPS server configuration";
services.nginx.virtualHosts = lib.mkOption {
type = lib.types.attrsOf (
lib.types.submodule {
config = lib.mkIf cfg.enable (
lib.mkDefault {
forceSSL = true;
kTLS = true;
}
);
}
);
};
};
config = lib.mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [ 443 ];
services.nginx = {
enable = true;
recommendedOptimisation = true;
recommendedTlsSettings = true;
recommendedProxySettings = true;
};
};
}