various: use more accurate int types (#445244)

This commit is contained in:
jopejoe1
2025-09-22 21:50:55 +00:00
committed by GitHub
19 changed files with 37 additions and 55 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ in
description = ''
The user IDs used in NixOS.
'';
type = types.attrsOf types.int;
type = types.attrsOf types.ints.u32;
};
ids.gids = lib.mkOption {
@@ -39,7 +39,7 @@ in
description = ''
The group IDs used in NixOS.
'';
type = types.attrsOf types.int;
type = types.attrsOf types.ints.u32;
};
};
+8 -8
View File
@@ -77,49 +77,49 @@ in
SYS_UID_MIN = lib.mkOption {
description = "Range of user IDs used for the creation of system users by useradd or newusers.";
default = 400;
type = lib.types.int;
type = lib.types.ints.u32;
};
SYS_UID_MAX = lib.mkOption {
description = "Range of user IDs used for the creation of system users by useradd or newusers.";
default = 999;
type = lib.types.int;
type = lib.types.ints.u32;
};
UID_MIN = lib.mkOption {
description = "Range of user IDs used for the creation of regular users by useradd or newusers.";
default = 1000;
type = lib.types.int;
type = lib.types.ints.u32;
};
UID_MAX = lib.mkOption {
description = "Range of user IDs used for the creation of regular users by useradd or newusers.";
default = 29999;
type = lib.types.int;
type = lib.types.ints.u32;
};
SYS_GID_MIN = lib.mkOption {
description = "Range of group IDs used for the creation of system groups by useradd, groupadd, or newusers";
default = 400;
type = lib.types.int;
type = lib.types.ints.u32;
};
SYS_GID_MAX = lib.mkOption {
description = "Range of group IDs used for the creation of system groups by useradd, groupadd, or newusers";
default = 999;
type = lib.types.int;
type = lib.types.ints.u32;
};
GID_MIN = lib.mkOption {
description = "Range of group IDs used for the creation of regular groups by useradd, groupadd, or newusers.";
default = 1000;
type = lib.types.int;
type = lib.types.ints.u32;
};
GID_MAX = lib.mkOption {
description = "Range of group IDs used for the creation of regular groups by useradd, groupadd, or newusers.";
default = 29999;
type = lib.types.int;
type = lib.types.ints.u32;
};
TTYGROUP = lib.mkOption {
@@ -65,7 +65,7 @@ in
};
nice = lib.mkOption {
type = lib.types.nullOr lib.types.int;
type = lib.types.nullOr (lib.types.ints.between (-20) 19);
default = null;
description = ''
Niceness of the compilation tasks.
@@ -72,7 +72,7 @@ in
package = lib.mkPackageOption pkgs "journalwatch" { };
priority = lib.mkOption {
type = lib.types.int;
type = lib.types.ints.between 0 7;
default = 6;
description = ''
Lowest priority of message to be considered.
@@ -43,7 +43,7 @@ in
description = "Password for mining server";
};
threads = lib.mkOption {
type = lib.types.int;
type = lib.types.ints.unsigned;
default = 0;
description = "Number of miner threads, defaults to available processors";
};
+4 -4
View File
@@ -107,7 +107,7 @@ in
package = mkPackageOption pkgs "chromium" { };
maxQueueSize = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 0;
description = "Maximum queue size for chromium-based conversions. Setting to 0 disables the limit.";
};
@@ -143,7 +143,7 @@ in
description = "Deny accepting URLs from these domains in the `downloadFrom` API field. Accepts a regular expression.";
};
maxRetries = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 4;
description = "The maximum amount of times to retry downloading a file specified with `downloadFrom`.";
};
@@ -158,13 +158,13 @@ in
package = mkPackageOption pkgs "libreoffice" { };
restartAfter = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 10;
description = "Restart LibreOffice after this many conversions. Setting to 0 disables this feature.";
};
maxQueueSize = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 0;
description = "Maximum queue size for LibreOffice-based conversions. Setting to 0 disables the limit.";
};
+1 -1
View File
@@ -61,7 +61,7 @@ in
};
log-level = lib.mkOption {
type = lib.types.int;
type = lib.types.ints.between 0 4;
description = ''
Specify the log level (0:none, 1:error, 2:warning, 3:notice, 4:debug).
'';
@@ -98,12 +98,7 @@ in
'';
};
report_delay = lib.mkOption {
type = lib.types.enum [
1
2
3
4
];
type = lib.types.ints.between 1 4;
default = 3;
description = ''
The interval between system status reportings.
@@ -15,7 +15,7 @@ in
enable = lib.mkEnableOption "Freenet daemon";
nice = lib.mkOption {
type = lib.types.int;
type = lib.types.ints.between (-20) 19;
default = 10;
description = "Set the nice level for the Freenet daemon";
};
@@ -274,7 +274,7 @@ in
channel = mkOption {
default = 0;
example = 11;
type = types.int;
type = types.ints.positive;
description = ''
The channel to operate on. Use 0 to enable ACS (Automatic Channel Selection).
Beware that not every device supports ACS in which case {command}`hostapd`
@@ -571,7 +571,7 @@ in
options = {
logLevel = mkOption {
default = 2;
type = types.int;
type = types.ints.between 0 4;
description = ''
Levels (minimum value for logged events):
0 = verbose debugging
@@ -957,7 +957,7 @@ in
vlanid = mkOption {
default = null;
example = 1;
type = types.nullOr types.int;
type = types.nullOr types.ints.unsigned;
description = "If this attribute is given, all clients using this entry will get tagged with the given VLAN ID.";
};
@@ -79,7 +79,7 @@ in
};
nice = mkOption {
type = types.int;
type = types.ints.between (-20) 19;
default = 5;
description = ''
The level of niceness to use.
+1 -1
View File
@@ -39,7 +39,7 @@ in
package = mkPackageOption pkgs "radvd" { };
debugLevel = mkOption {
type = types.int;
type = types.ints.between 0 5;
default = 0;
example = 5;
description = ''
@@ -139,7 +139,7 @@ in
};
downloadLimit = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 0;
example = 1024;
description = ''
@@ -148,7 +148,7 @@ in
};
uploadLimit = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 0;
example = 1024;
description = ''
+1 -8
View File
@@ -154,14 +154,7 @@ in
logLevel = lib.mkOption {
default = 1;
type = lib.types.enum [
0
1
2
3
4
5
];
type = lib.types.ints.between 0 5;
description = "Log level (0 = DEBUG, 5 = FATAL).";
};
@@ -108,13 +108,7 @@ in
};
LogLevel = lib.mkOption {
type = lib.types.enum [
0
1
2
3
4
];
type = lib.types.ints.between 0 4;
description = ''
Default log level from 0 to 4 (debug, info, important, warning,
error).
@@ -36,13 +36,13 @@ in
};
compressionLevel = lib.mkOption {
type = lib.types.nullOr lib.types.int;
type = lib.types.nullOr (lib.types.ints.between 0 16);
description = "The compression level for ZSTD compression (between 0 and 16)";
default = null;
};
jobs = lib.mkOption {
type = lib.types.nullOr lib.types.int;
type = lib.types.nullOr lib.types.ints.positive;
description = "Number of threads used for pushing store paths";
default = null;
};
@@ -704,14 +704,14 @@ in
};
maxClients = mkOption {
type = types.int;
type = types.ints.positive;
default = 150;
example = 8;
description = "Maximum number of httpd processes (prefork)";
};
maxRequestsPerChild = mkOption {
type = types.int;
type = types.ints.unsigned;
default = 0;
example = 500;
description = ''
@@ -74,7 +74,7 @@ in
};
requestTimeout = lib.mkOption {
type = lib.types.int;
type = lib.types.ints.unsigned;
default = 5;
description = ''
Number of seconds to wait for the client to send a complete
@@ -83,7 +83,7 @@ in
};
responseTimeout = lib.mkOption {
type = lib.types.int;
type = lib.types.ints.unsigned;
default = 0;
description = ''
Number of seconds to wait for the client to send a complete
+2 -2
View File
@@ -51,7 +51,7 @@ in
temperature = {
day = mkOption {
type = types.int;
type = types.ints.between 1000 25000;
default = 5500;
description = ''
Colour temperature to use during the day, between
@@ -59,7 +59,7 @@ in
'';
};
night = mkOption {
type = types.int;
type = types.ints.between 1000 25000;
default = 3700;
description = ''
Colour temperature to use at night, between