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`.
This commit is contained in:
networkException 2023-12-13 02:51:17 +01:00
parent 205f70b7fb
commit 439350753e
No known key found for this signature in database
GPG Key ID: E3877443AE684391
3 changed files with 19 additions and 9 deletions

View File

@ -67,6 +67,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
`globalRedirect` can now have redirect codes other than 301 through
`redirectCode`.
- [](#opt-boot.kernel.sysctl._net.core.wmem_max_) changed from a string to an integer because of the addition of a custom merge option (taking the highest value defined to avoid conflicts between 2 services trying to set that value), just as [](#opt-boot.kernel.sysctl._net.core.rmem_max_) since 22.11.
- Gitea 1.21 upgrade has several breaking changes, including:
- Custom themes and other assets that were previously stored in `custom/public/*` now belong in `custom/public/assets/*`
- New instances of Gitea using MySQL now ignore the `[database].CHARSET` config option and always use the `utf8mb4` charset, existing instances should migrate via the `gitea doctor convert` CLI command.

View File

@ -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 ''

View File

@ -434,7 +434,7 @@ in
# at least up to the values hardcoded here:
(mkIf cfg.settings.utp-enabled {
"net.core.rmem_max" = mkDefault 4194304; # 4MB
"net.core.wmem_max" = mkDefault "1048576"; # 1MB
"net.core.wmem_max" = mkDefault 1048576; # 1MB
})
(mkIf cfg.performanceNetParameters {
# Increase the number of available source (local) TCP and UDP ports to 49151.