{ config, lib, pkgs, ... }: let inherit (lib.modules) mkIf mkDefault; inherit (lib.options) mkEnableOption; cfg = config.modules.system.services.nginx; in { options.modules.system.services.nginx.enable = mkEnableOption "nginx"; config = mkIf cfg.enable { security = { acme = { acceptTerms = true; defaults.email = "charlie@charlieroot.dev"; }; }; services.nginx = { package = pkgs.nginxQuic; statusPage = true; recommendedTlsSettings = true; recommendedBrotliSettings = true; recommendedOptimisation = true; recommendedGzipSettings = true; recommendedProxySettings = true; # nginx defaults to a 1MB size limit for uploads, which # *definitely* isn't enough for Git LFS. # 'client_max_body_size 300m;' would set a limit of 300MB # setting it to 0 means "no limit" clientMaxBodySize = mkDefault "512m"; }; }; }