mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git
synced 2024-11-16 13:23:16 +00:00
26 lines
778 B
Nix
26 lines
778 B
Nix
{ config, pkgs, lib, ... }:
|
|
let
|
|
cfg = config.selfprivacy;
|
|
in
|
|
{
|
|
users.groups.acmereceivers.members = [ "nginx" ];
|
|
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;
|
|
reloadServices = [ "nginx" ];
|
|
};
|
|
certs = lib.mkForce {
|
|
"${cfg.domain}" = {
|
|
domain = "*.${cfg.domain}";
|
|
extraDomainNames = [ "${cfg.domain}" ];
|
|
group = "acmereceivers";
|
|
dnsProvider = lib.strings.toLower cfg.dns.provider;
|
|
credentialsFile = "/var/lib/cloudflare/Credentials.ini";
|
|
};
|
|
};
|
|
};
|
|
}
|