diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index f96d90941323..949531d9a83c 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -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; }; }; diff --git a/nixos/modules/programs/shadow.nix b/nixos/modules/programs/shadow.nix index e8eb756f8f59..049d5d0c78a7 100644 --- a/nixos/modules/programs/shadow.nix +++ b/nixos/modules/programs/shadow.nix @@ -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 { diff --git a/nixos/modules/services/development/distccd.nix b/nixos/modules/services/development/distccd.nix index 46d09911e2b7..29ea8767b283 100644 --- a/nixos/modules/services/development/distccd.nix +++ b/nixos/modules/services/development/distccd.nix @@ -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. diff --git a/nixos/modules/services/logging/journalwatch.nix b/nixos/modules/services/logging/journalwatch.nix index 19ec7f76af8c..7ec2144230ed 100644 --- a/nixos/modules/services/logging/journalwatch.nix +++ b/nixos/modules/services/logging/journalwatch.nix @@ -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. diff --git a/nixos/modules/services/misc/cpuminer-cryptonight.nix b/nixos/modules/services/misc/cpuminer-cryptonight.nix index adaee2bbb215..a06077497e22 100644 --- a/nixos/modules/services/misc/cpuminer-cryptonight.nix +++ b/nixos/modules/services/misc/cpuminer-cryptonight.nix @@ -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"; }; diff --git a/nixos/modules/services/misc/gotenberg.nix b/nixos/modules/services/misc/gotenberg.nix index e9a6388b970b..542aa342e5d6 100644 --- a/nixos/modules/services/misc/gotenberg.nix +++ b/nixos/modules/services/misc/gotenberg.nix @@ -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."; }; diff --git a/nixos/modules/services/misc/rshim.nix b/nixos/modules/services/misc/rshim.nix index 49296f0e2f05..37bcb40e16e7 100644 --- a/nixos/modules/services/misc/rshim.nix +++ b/nixos/modules/services/misc/rshim.nix @@ -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). ''; diff --git a/nixos/modules/services/monitoring/nezha-agent.nix b/nixos/modules/services/monitoring/nezha-agent.nix index 87ecbfdde710..e9161defe80b 100644 --- a/nixos/modules/services/monitoring/nezha-agent.nix +++ b/nixos/modules/services/monitoring/nezha-agent.nix @@ -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. diff --git a/nixos/modules/services/networking/freenet.nix b/nixos/modules/services/networking/freenet.nix index a0c67796377b..c95eb5d271af 100644 --- a/nixos/modules/services/networking/freenet.nix +++ b/nixos/modules/services/networking/freenet.nix @@ -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"; }; diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix index 5fa3cadb9a7e..a9c686763ca9 100644 --- a/nixos/modules/services/networking/hostapd.nix +++ b/nixos/modules/services/networking/hostapd.nix @@ -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."; }; diff --git a/nixos/modules/services/networking/icecream/daemon.nix b/nixos/modules/services/networking/icecream/daemon.nix index 789ff377bbaf..baf63539254f 100644 --- a/nixos/modules/services/networking/icecream/daemon.nix +++ b/nixos/modules/services/networking/icecream/daemon.nix @@ -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. diff --git a/nixos/modules/services/networking/radvd.nix b/nixos/modules/services/networking/radvd.nix index 17bc051fca20..19a0b293095d 100644 --- a/nixos/modules/services/networking/radvd.nix +++ b/nixos/modules/services/networking/radvd.nix @@ -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 = '' diff --git a/nixos/modules/services/networking/resilio.nix b/nixos/modules/services/networking/resilio.nix index 93e5b2c74cfc..2b72d7cbffc0 100644 --- a/nixos/modules/services/networking/resilio.nix +++ b/nixos/modules/services/networking/resilio.nix @@ -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 = '' diff --git a/nixos/modules/services/security/cfssl.nix b/nixos/modules/services/security/cfssl.nix index 514442dbe437..329002417a25 100644 --- a/nixos/modules/services/security/cfssl.nix +++ b/nixos/modules/services/security/cfssl.nix @@ -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)."; }; diff --git a/nixos/modules/services/security/opensnitch.nix b/nixos/modules/services/security/opensnitch.nix index 26c015a8107e..12643b20bd6a 100644 --- a/nixos/modules/services/security/opensnitch.nix +++ b/nixos/modules/services/security/opensnitch.nix @@ -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). diff --git a/nixos/modules/services/system/cachix-watch-store.nix b/nixos/modules/services/system/cachix-watch-store.nix index 0df74b927afa..b30a57cd4926 100644 --- a/nixos/modules/services/system/cachix-watch-store.nix +++ b/nixos/modules/services/system/cachix-watch-store.nix @@ -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; }; diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 07d4ad7fccfa..28d64a2e2bee 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -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 = '' diff --git a/nixos/modules/services/web-servers/stargazer.nix b/nixos/modules/services/web-servers/stargazer.nix index c29f0107cd0e..4af08aeba0c1 100644 --- a/nixos/modules/services/web-servers/stargazer.nix +++ b/nixos/modules/services/web-servers/stargazer.nix @@ -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 diff --git a/nixos/modules/services/x11/redshift.nix b/nixos/modules/services/x11/redshift.nix index 661053c20016..0ebde5bf642b 100644 --- a/nixos/modules/services/x11/redshift.nix +++ b/nixos/modules/services/x11/redshift.nix @@ -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