@@ -20,6 +20,16 @@ let
2020 '';
2121 };
2222
23+ server = mkOption {
24+ type = types.nullOr types.str;
25+ default = null;
26+ description = ''
27+ ACME Directory Resource URI. Defaults to let's encrypt
28+ production endpoint,
29+ https://acme-v02.api.letsencrypt.org/directory, if unset.
30+ '';
31+ };
32+
2333 domain = mkOption {
2434 type = types.str;
2535 default = name;
@@ -109,7 +119,15 @@ in
109119{
110120
111121 ###### interface
112−
122+ imports = [
123+ (mkRemovedOptionModule [ "security" "acme" "production" ] ''
124+ Use security.acme.server to define your staging ACME server URL instead.
125+
126+ To use the let's encrypt staging server, use security.acme.server =
127+ "https://acme-staging-v02.api.letsencrypt.org/directory".
128+ ''
129+ )
130+ ];
113131 options = {
114132 security.acme = {
115133
@@ -129,6 +147,16 @@ in
129147 '';
130148 };
131149
150+ server = mkOption {
151+ type = types.nullOr types.str;
152+ default = null;
153+ description = ''
154+ ACME Directory Resource URI. Defaults to let's encrypt
155+ production endpoint,
156+ <literal>https://acme-v02.api.letsencrypt.org/directory</literal>, if unset.
157+ '';
158+ };
159+
132160 preliminarySelfsigned = mkOption {
133161 type = types.bool;
134162 default = true;
@@ -142,20 +170,6 @@ in
142170 '';
143171 };
144172
145− production = mkOption {
146− type = types.bool;
147− default = true;
148− description = ''
149− If set to true, use Let's Encrypt's production environment
150− instead of the staging environment. The main benefit of the
151− staging environment is to get much higher rate limits.
152−
153− See
154− <literal>https://letsencrypt.org/docs/staging-environment</literal>
155− for more detail.
156− '';
157− };
158−
159173 certs = mkOption {
160174 default = { };
161175 type = with types; attrsOf (submodule certOpts);
@@ -198,7 +212,7 @@ in
198212 ++ optionals (data.email != null) [ "--email" data.email ]
199213 ++ concatMap (p: [ "-f" p ]) data.plugins
200214 ++ concatLists (mapAttrsToList (name: root: [ "-d" (if root == null then name else "${name}:${root}")]) data.extraDomains)
201− ++ optionals (!cfg.production) ["--server" "https://acme-staging-v02.api.letsencrypt.org/directory"];
215+ ++ optionals (cfg.server != null || data.server != null) ["--server" (if data.server == null then cfg.server else data.server)];
202216 acmeService = {
203217 description = "Renew ACME Certificate for ${cert}";
204218 after = [ "network.target" "network-online.target" ];