logcheck module: optionSet -> submodule

This commit is contained in:
Eric Sagnes 2016-09-11 16:46:00 +09:00
parent 495a24d912
commit c1cad56c6e

View File

@ -62,42 +62,46 @@ let
}; };
ignoreOptions = { ignoreOptions = {
level = levelOption; options = {
level = levelOption;
regex = mkOption { regex = mkOption {
default = ""; default = "";
type = types.str; type = types.str;
description = '' description = ''
Regex specifying which log lines to ignore. Regex specifying which log lines to ignore.
''; '';
};
}; };
}; };
ignoreCronOptions = { ignoreCronOptions = {
user = mkOption { options = {
default = "root"; user = mkOption {
type = types.str; default = "root";
description = '' type = types.str;
User that runs the cronjob. description = ''
''; User that runs the cronjob.
}; '';
};
cmdline = mkOption { cmdline = mkOption {
default = ""; default = "";
type = types.str; type = types.str;
description = '' description = ''
Command line for the cron job. Will be turned into a regex for the logcheck ignore rule. Command line for the cron job. Will be turned into a regex for the logcheck ignore rule.
''; '';
}; };
timeArgs = mkOption { timeArgs = mkOption {
default = null; default = null;
type = types.nullOr (types.str); type = types.nullOr (types.str);
example = "02 06 * * *"; example = "02 06 * * *";
description = '' description = ''
"min hr dom mon dow" crontab time args, to auto-create a cronjob too. "min hr dom mon dow" crontab time args, to auto-create a cronjob too.
Leave at null to not do this and just add a logcheck ignore rule. Leave at null to not do this and just add a logcheck ignore rule.
''; '';
};
}; };
}; };
@ -180,8 +184,7 @@ in
description = '' description = ''
This option defines extra ignore rules. This option defines extra ignore rules.
''; '';
type = types.loaOf types.optionSet; type = with types; loaOf (submodule ignoreOptions);
options = [ ignoreOptions ];
}; };
ignoreCron = mkOption { ignoreCron = mkOption {
@ -189,8 +192,7 @@ in
description = '' description = ''
This option defines extra ignore rules for cronjobs. This option defines extra ignore rules for cronjobs.
''; '';
type = types.loaOf types.optionSet; type = with types; loaOf (submodule ignoreCronOptions);
options = [ ignoreOptions ignoreCronOptions ];
}; };
extraGroups = mkOption { extraGroups = mkOption {