git.iko.soy/typeable/nixpkgs
on master help sign in
acme: Add "domain" option to separate domain from name

Fixes #24731.

commite3559c23c2c0c721627b60dae34c6de1ab685570 authoredanaher <github@edanaher.net> dateTue 11 Apr 2017, 12:28 (10 years ago) parent54fff9e
1 file changed+8−1
nixos/modules/security/acme.nix+8−1
nixos/modules/security/acme.nix+8−1
@@ -19,6 +19,12 @@ let
1919 '';
2020 };
2121
22+ domain = mkOption {
23+ type = types.nullOr types.str;
24+ default = null;
25+ description = "Domain to fetch certificate for (defaults to the entry name)";
26+ };
27+
2228 email = mkOption {
2329 type = types.nullOr types.str;
2430 default = null;
@@ -157,9 +163,10 @@ in
157163 servicesLists = mapAttrsToList certToServices cfg.certs;
158164 certToServices = cert: data:
159165 let
166+ domain = if data.domain != null then data.domain else cert;
160167 cpath = "${cfg.directory}/${cert}";
161168 rights = if data.allowKeysForGroup then "750" else "700";
162− cmdline = [ "-v" "-d" cert "--default_root" data.webroot "--valid_min" cfg.validMin ]
169+ cmdline = [ "-v" "-d" domain "--default_root" data.webroot "--valid_min" cfg.validMin ]
163170 ++ optionals (data.email != null) [ "--email" data.email ]
164171 ++ concatMap (p: [ "-f" p ]) data.plugins
165172 ++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains);