2023-09-06 11:20:33 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
2023-09-06 16:10:11 +03:00
|
|
|
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
|
2023-09-06 16:10:11 +03:00
|
|
|
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;
|
2023-12-10 09:36:24 +03:00
|
|
|
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 ];
|
2023-12-10 09:36:24 +03:00
|
|
|
networking.firewall.allowedUDPPorts = [ 80 443 ];
|
2023-09-06 11:20:33 +03:00
|
|
|
};
|
2023-09-06 16:10:11 +03:00
|
|
|
}
|