nixfiles/profiles/nginx.nix

48 lines
1.1 KiB
Nix

{
pkgs,
lib,
...
}: let
inherit (lib.options) mkOption;
inherit (lib.modules) mkDefault;
inherit (lib.types) submodule attrsOf;
in {
options = {
services.nginx.virtualHosts = mkOption {
type = attrsOf (submodule {
config.http3 = mkDefault true;
});
};
};
config = {
security.acme = {
defaults = {email = "chaoticryptidz@owo.monster";};
acceptTerms = true;
};
services.nginx = {
enable = true;
package = pkgs.nginxQuic;
recommendedGzipSettings = true;
recommendedBrotliSettings = true;
recommendedZstdSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
commonHttpConfig = "";
clientMaxBodySize = lib.mkDefault "512m";
serverNamesHashBucketSize = 1024;
mapHashMaxSize = 512;
};
services.logrotate.settings.nginx = {
minsize = "50M";
rotate = "4"; # 4 files of 50mb each
compress = "";
};
services.logrotate.settings.nginx.enable = true;
};
}