nixos/acme: validMin & renewInterval aren't cert-specific

Changed files
+18 -18
nixos
modules
security
+18 -18
nixos/modules/security/acme.nix
···
'';
};
-
validMin = mkOption {
-
type = types.int;
-
default = 30 * 24 * 3600;
-
description = "Minimum remaining validity before renewal in seconds.";
-
};
-
-
renewInterval = mkOption {
-
type = types.str;
-
default = "weekly";
-
description = ''
-
Systemd calendar expression when to check for renewal. See
-
<citerefentry><refentrytitle>systemd.time</refentrytitle>
-
<manvolnum>5</manvolnum></citerefentry>.
-
'';
-
};
-
email = mkOption {
type = types.nullOr types.str;
default = null;
···
'';
};
certs = mkOption {
default = { };
type = types.loaOf types.optionSet;
···
systemd.services = flip mapAttrs' cfg.certs (cert: data:
let
cpath = "${cfg.directory}/${cert}";
-
cmdline = [ "-v" "-d" cert "--default_root" data.webroot "--valid_min" data.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);
···
description = "timer for ACME cert renewal of ${cert}";
wantedBy = [ "timers.target" ];
timerConfig = {
-
OnCalendar = data.renewInterval;
Unit = "acme-simp_le-${cert}.service";
};
})
···
'';
};
email = mkOption {
type = types.nullOr types.str;
default = null;
···
'';
};
+
validMin = mkOption {
+
type = types.int;
+
default = 30 * 24 * 3600;
+
description = "Minimum remaining validity before renewal in seconds.";
+
};
+
+
renewInterval = mkOption {
+
type = types.str;
+
default = "weekly";
+
description = ''
+
Systemd calendar expression when to check for renewal. See
+
<citerefentry><refentrytitle>systemd.time</refentrytitle>
+
<manvolnum>5</manvolnum></citerefentry>.
+
'';
+
};
+
certs = mkOption {
default = { };
type = types.loaOf types.optionSet;
···
systemd.services = flip mapAttrs' cfg.certs (cert: data:
let
cpath = "${cfg.directory}/${cert}";
+
cmdline = [ "-v" "-d" cert "--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);
···
description = "timer for ACME cert renewal of ${cert}";
wantedBy = [ "timers.target" ];
timerConfig = {
+
OnCalendar = cfg.renewInterval;
Unit = "acme-simp_le-${cert}.service";
};
})