diff options
author | networkException <git@nwex.de> | 2023-12-13 02:51:17 +0100 |
---|---|---|
committer | networkException <git@nwex.de> | 2023-12-15 04:43:57 +0100 |
commit | 439350753ed2e27b0aa4fa1cfdf3ea80ea344644 (patch) | |
tree | 49286817696bd3af344eebc32638ff0c91c09ee5 /nixos/modules/config/sysctl.nix | |
parent | 205f70b7fba9da89a208d4b6d78ca64f6e36028d (diff) |
nixos/sysctl: use highest value on conflict for net.core.wmem_max
we previously defined a custom type for `boot.kernel.sysctl."net.core.rmem_max"` to resolve to the highest value set. this patch adds the same behavior to `"net.core.wmem_max"`. as this changes the type from a string to an integer, which is a breaking change this patch also includes a release note and updates the transmission module to use a number for `wmem_max`.
Diffstat (limited to 'nixos/modules/config/sysctl.nix')
-rw-r--r-- | nixos/modules/config/sysctl.nix | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/nixos/modules/config/sysctl.nix b/nixos/modules/config/sysctl.nix index 452c050b6dda9..b779f12aca30b 100644 --- a/nixos/modules/config/sysctl.nix +++ b/nixos/modules/config/sysctl.nix @@ -21,19 +21,27 @@ in options = { boot.kernel.sysctl = mkOption { - type = types.submodule { + type = let + highestValueType = types.ints.unsigned // { + merge = loc: defs: + foldl + (a: b: if b.value == null then null else lib.max a b.value) + 0 + (filterOverrides defs); + }; + in types.submodule { freeformType = types.attrsOf sysctlOption; options."net.core.rmem_max" = mkOption { - type = types.nullOr types.ints.unsigned // { - merge = loc: defs: - foldl - (a: b: if b.value == null then null else lib.max a b.value) - 0 - (filterOverrides defs); - }; + type = types.nullOr highestValueType; default = null; description = lib.mdDoc "The maximum socket receive buffer size. In case of conflicting values, the highest will be used."; }; + + options."net.core.wmem_max" = mkOption { + type = types.nullOr highestValueType; + default = null; + description = lib.mdDoc "The maximum socket send buffer size. In case of conflicting values, the highest will be used."; + }; }; default = {}; example = literalExpression '' |