summaryrefslogtreecommitdiff
path: root/profiles/server/nginx.nix
blob: d497833575d400f61b684711cc1f11c1cb3072b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ lib, ... }: with lib; {
  # apparently you can set defaults on existing modules?
  options.services.nginx.virtualHosts = mkOption {
    type = types.attrsOf (types.submodule ({ name, ... }: {
      config = mkIf (name != "default") {
        forceSSL = mkDefault true;
        enableACME = mkDefault true;
      };
    }));
  };
  config = {
    services.nginx = {
      enable = true;
      enableReload = true;
      recommendedTlsSettings = true;
      recommendedProxySettings = true;
      recommendedGzipSettings = true;
      recommendedOptimisation = true;

      virtualHosts."${ivi.domain}" = {
      };
    };
    networking.firewall.allowedTCPPorts = [ 80 443 ];
  };
}