nixos/roles/server/nginx.nix

25 lines
718 B
Nix
Raw Permalink Normal View History

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