Skip to content

Commit

Permalink
ACME module: add server option (#31122)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Etienne Meunier authored and globin committed Nov 2, 2017
1 parent ccbcf15 commit 538acd9
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion nixos/modules/security/acme.nix
Expand Up @@ -139,6 +139,20 @@ in
'';
};

production = mkOption {
type = types.bool;
default = true;
description = ''
If set to true, use Let's Encrypt's production environment
instead of the staging environment. The main benefit of the
staging environment is to get much higher rate limits.
See
<literal>https://letsencrypt.org/docs/staging-environment</literal>
for more detail.
'';
};

certs = mkOption {
default = { };
type = with types; attrsOf (submodule certOpts);
Expand Down Expand Up @@ -177,7 +191,9 @@ in
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);
++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains)
++ (if cfg.production then []
else ["--server" "https://acme-staging.api.letsencrypt.org/directory"]);
acmeService = {
description = "Renew ACME Certificate for ${cert}";
after = [ "network.target" "network-online.target" ];
Expand Down

0 comments on commit 538acd9

Please sign in to comment.