Skip to content

Commit

Permalink
acme: Add "domain" option to separate domain from name
Browse files Browse the repository at this point in the history
Fixes #24731.
  • Loading branch information
edanaher authored and fpletz committed Apr 11, 2017
1 parent 54fff9e commit e3559c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nixos/modules/security/acme.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ let
'';
};

domain = mkOption {
type = types.nullOr types.str;
default = null;
description = "Domain to fetch certificate for (defaults to the entry name)";
};

email = mkOption {
type = types.nullOr types.str;
default = null;
Expand Down Expand Up @@ -157,9 +163,10 @@ in
servicesLists = mapAttrsToList certToServices cfg.certs;
certToServices = cert: data:
let
domain = if data.domain != null then data.domain else cert;
cpath = "${cfg.directory}/${cert}";
rights = if data.allowKeysForGroup then "750" else "700";
cmdline = [ "-v" "-d" cert "--default_root" data.webroot "--valid_min" cfg.validMin ]
cmdline = [ "-v" "-d" domain "--default_root" data.webroot "--valid_min" cfg.validMin ]
++ optionals (data.email != null) [ "--email" data.email ]
++ concatMap (p: [ "-f" p ]) data.plugins
++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains);
Expand Down

0 comments on commit e3559c2

Please sign in to comment.