aboutsummaryrefslogtreecommitdiff
path: root/modules/nixos/services/web/default.nix
blob: cc9395cc791a33372efc980153d73e4701037df1 (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
{ options, config, lib, namespace, ... }:

with lib; with lib.${namespace}; let
  cfg = config.${namespace}.services.web;
  impermanence = config.${namespace}.system.impermanence;
in {
  options.${namespace}.services.web = with types; {
    enable = mkEnableOption "web";
  };

  config = mkIf cfg.enable {
    environment.persistence.${impermanence.location} = {
      directories = [
        "/var/lib/acme"
      ];
    };

    networking.firewall.allowedTCPPorts = [ 80 443 ];

    security.acme = {
      acceptTerms = true;
      defaults.email = "caroline@larimo.re";
    };
  };
}