{ config, lib, ... }:
{
  imports = [
    ./acme
    ./hosts
    ./rtmp
    ./user
  ];

  options.services.webserver.enable = lib.mkEnableOption "Nginx webpages";

  config = lib.mkIf config.services.nginx.enable {
    services.nginx = {
      recommendedTlsSettings = true;
      recommendedOptimisation = true;
      recommendedGzipSettings = true;
      recommendedProxySettings = true;
    };
    networking.firewall.allowedTCPPorts = [
      80
      443
    ];
  };
}
