@@ -150,6 +150,14 @@ let
150150 '';
151151 };
152152
153+ extraLegoFlags = mkOption {
154+ type = types.listOf types.str;
155+ default = [];
156+ description = ''
157+ Additional global flags to pass to all lego commands.
158+ '';
159+ };
160+
153161 extraLegoRenewFlags = mkOption {
154162 type = types.listOf types.str;
155163 default = [];
@@ -157,6 +165,14 @@ let
157165 Additional flags to pass to lego renew.
158166 '';
159167 };
168+
169+ extraLegoRunFlags = mkOption {
170+ type = types.listOf types.str;
171+ default = [];
172+ description = ''
173+ Additional flags to pass to lego run.
174+ '';
175+ };
160176 };
161177 };
162178
@@ -313,9 +329,10 @@ in
313329 ++ optionals (data.dnsProvider != null && !data.dnsPropagationCheck) [ "--dns.disable-cp" ]
314330 ++ concatLists (mapAttrsToList (name: root: [ "-d" name ]) data.extraDomains)
315331 ++ (if data.dnsProvider != null then [ "--dns" data.dnsProvider ] else [ "--http" "--http.webroot" data.webroot ])
316− ++ optionals (cfg.server != null || data.server != null) ["--server" (if data.server == null then cfg.server else data.server)];
332+ ++ optionals (cfg.server != null || data.server != null) ["--server" (if data.server == null then cfg.server else data.server)]
333+ ++ data.extraLegoFlags;
317334 certOpts = optionals data.ocspMustStaple [ "--must-staple" ];
318− runOpts = escapeShellArgs (globalOpts ++ [ "run" ] ++ certOpts);
335+ runOpts = escapeShellArgs (globalOpts ++ [ "run" ] ++ certOpts ++ data.extraLegoRunFlags);
319336 renewOpts = escapeShellArgs (globalOpts ++
320337 [ "renew" "--days" (toString cfg.validMinDays) ] ++
321338 certOpts ++ data.extraLegoRenewFlags);