From 9467f2ba2c38fd04565c7f0fd04e0e2c2673f650 Mon Sep 17 00:00:00 2001 From: Lucas Savva Date: Sun, 12 Jan 2020 21:52:28 +0000 Subject: [PATCH] nixos/acme: Add logic to select right email address --- nixos/modules/security/acme.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix index 9375115ddcbc..3d63fc25711a 100644 --- a/nixos/modules/security/acme.nix +++ b/nixos/modules/security/acme.nix @@ -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)