From f08f3812f40322b6098d75573413ed83f358871f Mon Sep 17 00:00:00 2001 From: Kleidi Bujari Date: Sun, 1 Dec 2024 22:30:26 -0500 Subject: Cleanup xnet module and add baseline modules With these changes, the xnet module is useable as a system builder. At this point, it is still undecided whether all configuration will be generalized into this module, rather than keeping mini-modules local to the machine they will run on. --- modules/xnet/nginx.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 modules/xnet/nginx.nix (limited to 'modules/xnet/nginx.nix') diff --git a/modules/xnet/nginx.nix b/modules/xnet/nginx.nix new file mode 100644 index 0000000..1a3df78 --- /dev/null +++ b/modules/xnet/nginx.nix @@ -0,0 +1,30 @@ +{ config, lib, ... }: +let + cfg = config.xnet.nginx; + + inherit (lib) mkOption mkIf types; +in +{ + + options.xnet.nginx = { + enable = mkOption { + type = types.bool; + default = false; + description = "Enable optimized nginx."; + }; + }; + + config = mkIf cfg.enable { + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.nginx = { + enable = true; + recommendedBrotliSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedZstdSettings = true; + }; + }; +} -- cgit v1.3.1