-
Notifications
You must be signed in to change notification settings - Fork 0
/
acme.nix
37 lines (33 loc) · 954 Bytes
/
acme.nix
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
34
35
36
37
{ lib, config, ... }:
let cfg = config.homelab.acme;
in {
options.homelab.acme = {
email = lib.mkOption {
type = lib.types.str;
description = "The email address to use for ACME registration";
};
dnsProvider = lib.mkOption {
type = lib.types.str;
description = "The DNS provider to use for ACME DNS-01 challenges";
};
credentialsFile = lib.mkOption {
type = lib.types.path;
description = "The file to use for storing ACME credentials";
};
};
config = {
networking.firewall.allowedTCPPorts = [ 80 443 ];
security.acme = {
acceptTerms = true;
defaults = {
email = cfg.email;
credentialsFile = cfg.credentialsFile;
dnsProvider = cfg.dnsProvider;
};
certs.${config.homelab.domain} = {
extraDomainNames = [ "*.${config.homelab.domain}" ];
};
};
users.groups.acme.members = [ config.services.nginx.user ];
};
}