summary refs log tree commit diff
diff options
context:
space:
mode:
authorEric Sagnes <eric.sagnes@gmail.com>2016-09-11 16:46:00 +0900
committerEric Sagnes <eric.sagnes@gmail.com>2016-09-13 12:53:09 +0900
commitc1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999 (patch)
tree66a9778b75517d100fba4ac9a3963cba445f88ed
parent495a24d9125731c375f3f262c811c5eea5ade013 (diff)
downloadnixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.tar
nixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.tar.gz
nixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.tar.bz2
nixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.tar.lz
nixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.tar.xz
nixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.tar.zst
nixpkgs-c1cad56c6e2761f4d6ae9c9ca9b445a0ca2ee999.zip
logcheck module: optionSet -> submodule
-rw-r--r--nixos/modules/services/logging/logcheck.nix68
1 files changed, 35 insertions, 33 deletions
diff --git a/nixos/modules/services/logging/logcheck.nix b/nixos/modules/services/logging/logcheck.nix
index 3a85fa60fe7..a8a214b2155 100644
--- a/nixos/modules/services/logging/logcheck.nix
+++ b/nixos/modules/services/logging/logcheck.nix
@@ -62,42 +62,46 @@ let
   };
 
   ignoreOptions = {
-    level = levelOption;
+    options = {
+      level = levelOption;
 
-    regex = mkOption {
-      default = "";
-      type = types.str;
-      description = ''
-        Regex specifying which log lines to ignore.
-      '';
+      regex = mkOption {
+        default = "";
+        type = types.str;
+        description = ''
+          Regex specifying which log lines to ignore.
+        '';
+      };
     };
   };
 
   ignoreCronOptions = {
-    user = mkOption {
-      default = "root";
-      type = types.str;
-      description = ''
-        User that runs the cronjob.
-      '';
-    };
+    options = {
+      user = mkOption {
+        default = "root";
+        type = types.str;
+        description = ''
+          User that runs the cronjob.
+        '';
+      };
 
-    cmdline = mkOption {
-      default = "";
-      type = types.str;
-      description = ''
-        Command line for the cron job. Will be turned into a regex for the logcheck ignore rule.
-      '';
-    };
+      cmdline = mkOption {
+        default = "";
+        type = types.str;
+        description = ''
+          Command line for the cron job. Will be turned into a regex for the logcheck ignore rule.
+        '';
+      };
 
-    timeArgs = mkOption {
-      default = null;
-      type = types.nullOr (types.str);
-      example = "02 06 * * *";
-      description = ''
-        "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.
-      '';
+      timeArgs = mkOption {
+        default = null;
+        type = types.nullOr (types.str);
+        example = "02 06 * * *";
+        description = ''
+          "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.
+        '';
+      };
     };
   };
 
@@ -180,8 +184,7 @@ in
         description = ''
           This option defines extra ignore rules.
         '';
-        type = types.loaOf types.optionSet;
-        options = [ ignoreOptions ];
+        type = with types; loaOf (submodule ignoreOptions);
       };
 
       ignoreCron = mkOption {
@@ -189,8 +192,7 @@ in
         description = ''
           This option defines extra ignore rules for cronjobs.
         '';
-        type = types.loaOf types.optionSet;
-        options = [ ignoreOptions ignoreCronOptions ];
+        type = with types; loaOf (submodule ignoreCronOptions);
       };
 
       extraGroups = mkOption {