summary refs log tree commit diff
path: root/nixos/modules/security/acme.nix
diff options
context:
space:
mode:
authorLucas Savva <lucas@m1cr0man.com>2020-01-12 21:52:28 +0000
committerLucas Savva <lucas@m1cr0man.com>2020-01-12 21:52:28 +0000
commit9467f2ba2c38fd04565c7f0fd04e0e2c2673f650 (patch)
tree3e136beaf1ebd5ba81684bb18fe094779a09274b /nixos/modules/security/acme.nix
parent1e3607d331a650e958b48e0c6a9231e68dd023f8 (diff)
downloadnixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.tar
nixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.tar.gz
nixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.tar.bz2
nixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.tar.lz
nixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.tar.xz
nixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.tar.zst
nixpkgs-9467f2ba2c38fd04565c7f0fd04e0e2c2673f650.zip
nixos/acme: Add logic to select right email address
Diffstat (limited to 'nixos/modules/security/acme.nix')
-rw-r--r--nixos/modules/security/acme.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix
index 9375115ddcb..3d63fc25711 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)