nixos/acme: Add logic to select right email address

This commit is contained in:
Lucas Savva 2020-01-12 21:52:28 +00:00
parent 1e3607d331
commit 9467f2ba2c

View File

@ -258,7 +258,8 @@ in
apath = "/var/lib/${lpath}";
spath = "/var/lib/acme/.lego";
rights = if data.allowKeysForGroup then "750" else "700";
globalOpts = [ "-d" data.domain "--email" data.email "--path" "." ]
email = if data.email == null then cfg.email else data.email;
globalOpts = [ "-d" data.domain "--email" email "--path" "." ]
++ optionals (cfg.acceptTerms) [ "--accept-tos" ]
++ optionals (data.dnsProvider != null && !cfg.dnsPropagationCheck) [ "--dns.disable-cp" ]
++ concatLists (mapAttrsToList (name: root: [ "-d" name ]) data.extraDomains)