nixos/roles/server/nginx.nix
Ivan Bushchik 89c283ee99
Enable http/3 on all websites
Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
2023-12-10 09:36:24 +03:00

25 lines
718 B
Nix

{ config, lib, pkgs, ... }:
let cfg = config.my.roles.server.nginx;
in {
# Don't call from machine setup, services will enable it automatically
options.my.roles.server.nginx.enable =
lib.mkEnableOption "Initial nginx setup";
config = lib.mkIf (cfg.enable) {
services.nginx = {
enable = true;
package = pkgs.nginxQuic;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
security.acme = {
acceptTerms = true;
defaults.email = "ivabus@ivabus.dev";
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 80 443 ];
};
}