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)