nixos/hylafax: use `lib.types.ints.positive`

I haven't realized earlier that there is
already an option type for postive integers.

Yarny0 449647da b5464b00

Changed files
+7 -8
nixos
modules
services
networking
hylafax
+7 -8
nixos/modules/services/networking/hylafax/options.nix
···
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 = ''
···
'';
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
···
# 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
···
'';
};
faxcron.infoDays = mkOption {
-
type = int1;
+
type = ints.positive;
default = 30;
description = ''
Set the expiration time for data in the
···
'';
};
faxcron.logDays = mkOption {
-
type = int1;
+
type = ints.positive;
default = 30;
description = ''
Set the expiration time for
···
'';
};
faxcron.rcvDays = mkOption {
-
type = int1;
+
type = ints.positive;
default = 7;
description = ''
Set the expiration time for files in
···
'';
};
faxqclean.doneqMinutes = mkOption {
-
type = int1;
+
type = ints.positive;
default = 15;
example = literalExample "24*60";
description = ''
···
'';
};
faxqclean.docqMinutes = mkOption {
-
type = int1;
+
type = ints.positive;
default = 60;
example = literalExample "24*60";
description = ''