2020-10-01 15:46:04 -07:00
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
with lib;
|
2020-10-01 15:46:04 -07:00
|
|
|
with lib.my;
|
|
|
|
let cfg = config.modules.services.nginx;
|
|
|
|
in {
|
2020-03-28 22:48:43 -07:00
|
|
|
options.modules.services.nginx = {
|
2020-10-01 15:46:04 -07:00
|
|
|
enable = mkBoolOpt false;
|
2020-03-28 22:48:43 -07:00
|
|
|
};
|
|
|
|
|
2020-10-01 15:46:04 -07:00
|
|
|
config = mkIf cfg.enable {
|
2020-03-28 22:48:43 -07:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
2019-11-17 22:24:50 -08:00
|
|
|
|
2021-01-01 21:26:07 -08:00
|
|
|
user.extraGroups = [ "nginx" ];
|
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
2019-11-17 22:24:50 -08:00
|
|
|
|
2020-03-28 22:48:43 -07:00
|
|
|
# Use recommended settings
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
};
|
2019-11-17 22:24:50 -08:00
|
|
|
};
|
|
|
|
}
|