selfprivacy-nixos-config/letsencrypt/acme.nix

26 lines
778 B
Nix
Raw Normal View History

2022-02-16 05:01:12 +00:00
{ config, pkgs, lib, ... }:
2021-11-15 10:02:05 +00:00
let
cfg = config.selfprivacy;
2021-11-15 10:02:05 +00:00
in
{
2023-12-01 04:42:03 +00:00
users.groups.acmereceivers.members = [ "nginx" ];
2021-11-15 10:02:05 +00:00
security.acme = {
acceptTerms = true;
defaults = {
email = "${cfg.username}@${cfg.domain}";
server = if cfg.dns.useStagingACME then "https://acme-staging-v02.api.letsencrypt.org/directory" else "https://acme-v02.api.letsencrypt.org/directory";
dnsPropagationCheck = false;
2023-06-14 16:06:58 +00:00
reloadServices = [ "nginx" ];
};
certs = lib.mkForce {
2021-11-15 10:02:05 +00:00
"${cfg.domain}" = {
domain = "*.${cfg.domain}";
extraDomainNames = [ "${cfg.domain}" ];
group = "acmereceivers";
dnsProvider = lib.strings.toLower cfg.dns.provider;
credentialsFile = "/var/lib/cloudflare/Credentials.ini";
2021-11-15 10:02:05 +00:00
};
};
};
}