about summary refs log tree commit diff
path: root/nixos/modules/services/networking/hylafax
diff options
context:
space:
mode:
authorYarny0 <41838844+Yarny0@users.noreply.github.com>2021-05-08 20:44:32 +0200
committerYarny0 <41838844+Yarny0@users.noreply.github.com>2021-05-14 05:42:17 +0200
commit449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3 (patch)
tree21939ab43f3a29eb7711332d456e4cfdf92760fc /nixos/modules/services/networking/hylafax
parentb5464b008f32699b0307a58ff7ce80de91bcfb5f (diff)
downloadnixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.tar
nixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.tar.gz
nixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.tar.bz2
nixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.tar.lz
nixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.tar.xz
nixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.tar.zst
nixlib-449647daf50c0707e3e5fa6ae9e4c9523fb3dbb3.zip
nixos/hylafax: use `lib.types.ints.positive`
I haven't realized earlier that there is
already an option type for postive integers.
Diffstat (limited to 'nixos/modules/services/networking/hylafax')
-rw-r--r--nixos/modules/services/networking/hylafax/options.nix15
1 files changed, 7 insertions, 8 deletions
diff --git a/nixos/modules/services/networking/hylafax/options.nix b/nixos/modules/services/networking/hylafax/options.nix
index 7f18c0d39ab4..74960e69b9ac 100644
--- a/nixos/modules/services/networking/hylafax/options.nix
+++ b/nixos/modules/services/networking/hylafax/options.nix
@@ -3,7 +3,7 @@
 let
 
   inherit (lib.options) literalExample mkEnableOption mkOption;
-  inherit (lib.types) bool enum int lines attrsOf nullOr path str submodule;
+  inherit (lib.types) bool enum ints lines attrsOf nullOr path str submodule;
   inherit (lib.modules) mkDefault mkIf mkMerge;
 
   commonDescr = ''
@@ -18,7 +18,6 @@ let
   '';
 
   str1 = lib.types.addCheck str (s: s!="");  # non-empty string
-  int1 = lib.types.addCheck int (i: i>0);  # positive integer
 
   configAttrType =
     # Options in HylaFAX configuration files can be
@@ -27,7 +26,7 @@ let
     # This type definition resolves all
     # those types into a list of strings.
     let
-      inherit (lib.types) attrsOf coercedTo listOf;
+      inherit (lib.types) attrsOf coercedTo int listOf;
       innerType = coercedTo bool (x: if x then "Yes" else "No")
         (coercedTo int (toString) str);
     in
@@ -290,7 +289,7 @@ in
       '';
     };
     faxcron.infoDays = mkOption {
-      type = int1;
+      type = ints.positive;
       default = 30;
       description = ''
         Set the expiration time for data in the
@@ -298,7 +297,7 @@ in
       '';
     };
     faxcron.logDays = mkOption {
-      type = int1;
+      type = ints.positive;
       default = 30;
       description = ''
         Set the expiration time for
@@ -306,7 +305,7 @@ in
       '';
     };
     faxcron.rcvDays = mkOption {
-      type = int1;
+      type = ints.positive;
       default = 7;
       description = ''
         Set the expiration time for files in
@@ -343,7 +342,7 @@ in
       '';
     };
     faxqclean.doneqMinutes = mkOption {
-      type = int1;
+      type = ints.positive;
       default = 15;
       example = literalExample "24*60";
       description = ''
@@ -353,7 +352,7 @@ in
       '';
     };
     faxqclean.docqMinutes = mkOption {
-      type = int1;
+      type = ints.positive;
       default = 60;
       example = literalExample "24*60";
       description = ''