diff --git a/modules/server/default.nix b/modules/server/default.nix index 8fc8beba..ed5dcd55 100644 --- a/modules/server/default.nix +++ b/modules/server/default.nix @@ -2,7 +2,7 @@ with lib; let cfg = config.void.server; in { - imports = [ ./dns ]; + imports = [ ./dns ./nginx.nix ]; options.void.server = { isServer = mkEnableOption false; }; diff --git a/modules/server/nginx.nix b/modules/server/nginx.nix new file mode 100644 index 00000000..6bece28c --- /dev/null +++ b/modules/server/nginx.nix @@ -0,0 +1,30 @@ +{ config, lib, ... }: +with lib; +let cfg = config.void.server.nginx; +in { + imports = [ ./dns ]; + + options.void.server.nginx = { enable = mkEnableOption false; }; + + config = mkIf cfg.enable { + security.acme = { + acceptTerms = true; + defaults.email = "Sayeko@proton.me"; + }; + services.nginx = { + enable = true; + recommendedTlsSettings = true; + recommendedBrotliSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + recommendedZstdSettings = true; + + commonHttpConfig = '' + access_log /var/log/nginx/access.log combined_anon buffer=32k flush=5m; + error_log /var/log/nginx/error.log warn; + ''; + }; + + }; +}