Massive refactoring into module-based approach

This commit is contained in:
Vili Sinervä 2025-07-06 01:16:28 +03:00
parent 8d5c9be5b6
commit 9652d7c330
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
118 changed files with 2586 additions and 2159 deletions

View file

@ -0,0 +1,36 @@
{ config, lib, ... }:
let
cfg = config.custom.nginxHttpsServer;
in
{
options = {
custom.nginxHttpsServer.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
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;
};
};
}