Files
nixos-configs/hosts/tadpole/modules/nginx/default.nix
2024-09-17 21:11:31 +02:00

38 lines
555 B
Nix

{ lib, config, ... }:
let
enabled = config.mod.nginx.enable;
in
{
options = {
mod.nginx = {
enable = lib.mkEnableOption "add nginx module";
};
};
config = lib.mkIf enabled {
security = {
acme = {
acceptTerms = true;
};
};
services = {
nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
};
networking = {
firewall = {
allowedTCPPorts = [
80
443
];
};
};
};
}