aboutsummaryrefslogtreecommitdiff
path: root/nix/web.nix
blob: 8ccad04db725cda7d33a5f6e2748d40d70c4b1d0 (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
26
27
28
29
30
31
32
33
{ inputs, pkgs, ... }:
let
  domain = "kassouni.net";
in
{
  services.nginx = {
    enable = true;
    recommendedGzipSettings = true;
    recommendedOptimisation = true;
    recommendedProxySettings = true;
    recommendedTlsSettings = true;

    virtualHosts = {
      ${domain} = {
        default = true;
        serverAliases = [ "www.${domain}" ];
        forceSSL = true;
        enableACME = true;
        root = inputs.self.packages.${pkgs.stdenv.hostPlatform.system}.website;
      };
    };
  };

  security.acme = {
    acceptTerms = true;
    defaults.email = "alex@${domain}";
  };

  networking.firewall.allowedTCPPorts = [
    80
    443
  ];
}