diff options
author | happysalada <raphael@megzari.com> | 2022-11-08 08:14:00 -0500 |
---|---|---|
committer | Yt <happysalada@proton.me> | 2022-11-08 10:30:10 -0500 |
commit | 2c5abd89c7e917acde9077fc4d12596e35b73e17 (patch) | |
tree | 2408545cd55c26fb6edf08dbea998d6305abc229 /nixos/modules/config | |
parent | 0ea6f4c9749d9bc9c079b901279613b441103aa2 (diff) |
rmem_max: define merge function
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/sysctl.nix | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/nixos/modules/config/sysctl.nix b/nixos/modules/config/sysctl.nix index b4b2d0452c4f2..4346c88f7688c 100644 --- a/nixos/modules/config/sysctl.nix +++ b/nixos/modules/config/sysctl.nix @@ -21,11 +21,24 @@ in options = { boot.kernel.sysctl = mkOption { + type = 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); + }; + default = null; + description = lib.mdDoc "The maximum socket receive buffer size. In case of conflicting values, the highest will be used."; + }; + }; default = {}; example = literalExpression '' { "net.ipv4.tcp_syncookies" = false; "vm.swappiness" = 60; } ''; - type = types.attrsOf sysctlOption; description = lib.mdDoc '' Runtime parameters of the Linux kernel, as set by {manpage}`sysctl(8)`. Note that sysctl @@ -35,6 +48,7 @@ in parameter may be a string, integer, boolean, or null (signifying the option will not appear at all). ''; + }; }; |