nixos/postgrey: prefer `types.ints` over `addCheck`

h7x4 3c811c4f c1a2638d

Changed files
+6 -9
nixos
modules
services
+6 -9
nixos/modules/services/mail/postgrey.nix
···
cfg = config.services.postgrey;
-
natural = with types; addCheck int (x: x >= 0);
-
natural' = with types; addCheck int (x: x > 0);
-
socket =
with types;
addCheck (either (submodule unixSocket) (submodule inetSocket)) (x: x ? path || x ? port);
···
description = "Prepend header to greylisted mails; use %%t for seconds delayed due to greylisting, %%v for the version of postgrey, %%d for the date, and %%h for the host";
};
delay = mkOption {
-
type = natural;
+
type = ints.unsigned;
default = 300;
description = "Greylist for N seconds";
};
maxAge = mkOption {
-
type = natural;
+
type = ints.unsigned;
default = 35;
description = "Delete entries from whitelist if they haven't been seen for N days";
};
retryWindow = mkOption {
-
type = either str natural;
+
type = either str ints.unsigned;
default = 2;
example = "12h";
description = "Allow N days for the first retry. Use string with appended 'h' to specify time in hours";
···
description = "Strip the last N bits from IP addresses, determined by IPv4CIDR and IPv6CIDR";
};
IPv4CIDR = mkOption {
-
type = natural;
+
type = ints.unsigned;
default = 24;
description = "Strip N bits from IPv4 addresses if lookupBySubnet is true";
};
IPv6CIDR = mkOption {
-
type = natural;
+
type = ints.unsigned;
default = 64;
description = "Strip N bits from IPv6 addresses if lookupBySubnet is true";
};
···
description = "Store data using one-way hash functions (SHA1)";
};
autoWhitelist = mkOption {
-
type = nullOr natural';
+
type = nullOr ints.positive;
default = 5;
description = "Whitelist clients after successful delivery of N messages";
};