2022-08-29 18:58:34 -04:00
|
|
|
{ config, lib, pkgs, ... }:
|
2022-10-13 22:13:43 -04:00
|
|
|
let nathan = config.nathan;
|
|
|
|
in with lib; {
|
2022-08-29 18:58:34 -04:00
|
|
|
config = mkMerge [
|
|
|
|
(mkIf nathan.services.nginx.enable {
|
|
|
|
networking.firewall = {
|
|
|
|
allowedTCPPorts = [ 80 443 ];
|
|
|
|
allowedUDPPorts = [ 80 443 ];
|
|
|
|
};
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
};
|
2023-06-19 02:43:14 -04:00
|
|
|
# Only keep 7 days of logs
|
|
|
|
services.logrotate.settings.nginx = {
|
|
|
|
rotate = 7;
|
|
|
|
frequency = "daily";
|
|
|
|
};
|
2022-08-29 18:58:34 -04:00
|
|
|
})
|
|
|
|
(mkIf nathan.services.nginx.acme {
|
|
|
|
security.acme = {
|
|
|
|
defaults.email = nathan.config.email;
|
|
|
|
acceptTerms = true;
|
|
|
|
};
|
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|