nixos/acme: simplify email resolve logic

This commit is contained in:
Lucas Savva 2020-02-03 21:37:22 +00:00
parent 769fbf9254
commit 2181313c54
No known key found for this signature in database
GPG key ID: F9CE6D3DCDC78F2D

View file

@ -37,7 +37,7 @@ let
email = mkOption {
type = types.nullOr types.str;
default = null;
default = cfg.email;
description = "Contact email address for the CA to be able to reach you.";
};
@ -282,8 +282,7 @@ in
apath = "/var/lib/${lpath}";
spath = "/var/lib/acme/.lego";
rights = if data.allowKeysForGroup then "750" else "700";
email = if data.email == null then cfg.email else data.email;
globalOpts = [ "-d" data.domain "--email" email "--path" "." "--key-type" data.keyType ]
globalOpts = [ "-d" data.domain "--email" data.email "--path" "." "--key-type" data.keyType ]
++ optionals (cfg.acceptTerms) [ "--accept-tos" ]
++ optionals (data.dnsProvider != null && !data.dnsPropagationCheck) [ "--dns.disable-cp" ]
++ concatLists (mapAttrsToList (name: root: [ "-d" name ]) data.extraDomains)