From 5a967f4a1ec77245fafae1247979f75c03276eca Mon Sep 17 00:00:00 2001 From: Luflosi Date: Tue, 8 Jul 2025 20:08:38 +0200 Subject: [PATCH 1/3] nixos/kubo: increase maximum UDP buffer sizes The [quic-go wiki](https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes) now recommends a larger maximum send- and receive buffer size. The change to the documentation was made in April 2024: https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes/_compare/597639d834d5d6c242d37d49a02ed04ca65332c9...a3327deff89d2428d48596ce0e643531f9944f99. Without this change, the Kubo daemon will output this warning: ``` failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 7168 kiB, got: 4882 kiB). See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details. ``` This can be seen while running the NixOS tests. --- nixos/modules/services/network-filesystems/kubo.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/network-filesystems/kubo.nix b/nixos/modules/services/network-filesystems/kubo.nix index 87d83971c706..8c1053f3a55a 100644 --- a/nixos/modules/services/network-filesystems/kubo.nix +++ b/nixos/modules/services/network-filesystems/kubo.nix @@ -330,8 +330,8 @@ in environment.variables.IPFS_PATH = fakeKuboRepo; # https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes - boot.kernel.sysctl."net.core.rmem_max" = lib.mkDefault 2500000; - boot.kernel.sysctl."net.core.wmem_max" = lib.mkDefault 2500000; + boot.kernel.sysctl."net.core.rmem_max" = lib.mkDefault 7500000; + boot.kernel.sysctl."net.core.wmem_max" = lib.mkDefault 7500000; programs.fuse = lib.mkIf cfg.autoMount { userAllowOther = true; From 5fcc08a90708e5752f84e07bd6174f353dc23d28 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sun, 19 Oct 2025 12:39:48 +0200 Subject: [PATCH 2/3] kubo: 0.36.0 -> 0.37.0 https://github.com/ipfs/kubo/releases/tag/v0.37.0 Kubo v0.37.0 embeds the repository migration from repo version v16 to v17 and the kubo-fs-repo-migrations package will not reveive any more updates. I'll keep the `kubo-fs-repo-migrations` and `kubo-migrator` packages around for now until a future version of Kubo no longer supports calling the external migration binaries. Since the (newest) migrations are now built into Kubo, the NixOS module now needs to call `ipfs repo migrate --to=xx --allow-downgrade` instead of `fs-repo-migrations --to xx -y`. The `--allow-downgrade` flag is only there for the unlikely situation that someone downgrades their local Kubo version with an overlay, separate channel input or similar means. It does however not work for rolling back the NixOS generation after a Kubo upgrade which increases the repo version (not all Kubo upgrades increase the repo version). This is because the Kubo version of the previous NixOS generation doesn't have the code for upgrading to or downgrading from the newer repo version. Since we only have one version of Kubo in Nixpkgs at a time, migrations cannot be tested automatically. I manually verified that `ipfs repo migrate` uses binaries like `fs-repo-15-to-16` provided by the `kubo-fs-repo-migrations` packages for older migrations. I also tested that the migration from v16 to v17 works on my machine using the NixOS module. --- nixos/modules/services/network-filesystems/kubo.nix | 10 ++++------ pkgs/by-name/ku/kubo-fs-repo-migrations/package.nix | 3 ++- pkgs/by-name/ku/kubo/package.nix | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/nixos/modules/services/network-filesystems/kubo.nix b/nixos/modules/services/network-filesystems/kubo.nix index 8c1053f3a55a..de4718229797 100644 --- a/nixos/modules/services/network-filesystems/kubo.nix +++ b/nixos/modules/services/network-filesystems/kubo.nix @@ -167,7 +167,7 @@ in autoMigrate = lib.mkOption { type = lib.types.bool; default = true; - description = "Whether Kubo should try to run the fs-repo-migration at startup."; + description = "Whether Kubo should try to migrate its filesystem repository automatically."; }; enableGC = lib.mkOption { @@ -344,9 +344,6 @@ in createHome = false; uid = config.ids.uids.ipfs; description = "IPFS daemon user"; - packages = [ - pkgs.kubo-migrator - ]; }; }; @@ -377,6 +374,7 @@ in path = [ "/run/wrappers" cfg.package + pkgs.kubo-fs-repo-migrations # Used by 'ipfs repo migrate --to=...' ]; environment.IPFS_PATH = cfg.dataDir; @@ -388,7 +386,7 @@ in rm -vf "$IPFS_PATH/api" '' + lib.optionalString cfg.autoMigrate '' - '${lib.getExe pkgs.kubo-migrator}' -to '${cfg.package.repoVersion}' -y + '${lib.getExe cfg.package}' repo migrate '--to=${cfg.package.repoVersion}' --allow-downgrade '' + '' fi @@ -412,7 +410,7 @@ in serviceConfig = { ExecStart = [ "" - "${cfg.package}/bin/ipfs daemon ${kuboFlags}" + "${lib.getExe cfg.package} daemon ${kuboFlags}" ]; User = cfg.user; Group = cfg.group; diff --git a/pkgs/by-name/ku/kubo-fs-repo-migrations/package.nix b/pkgs/by-name/ku/kubo-fs-repo-migrations/package.nix index 7496c1ed274c..463a79a43405 100644 --- a/pkgs/by-name/ku/kubo-fs-repo-migrations/package.nix +++ b/pkgs/by-name/ku/kubo-fs-repo-migrations/package.nix @@ -258,7 +258,8 @@ symlinkJoin { longDescription = '' This package contains all the individual migrations in the bin directory. This is used by fs-repo-migrations and could also be used by Kubo itself - when starting it like this: ipfs daemon --migrate + when starting it like this: `ipfs daemon --migrate` + or when calling `ipfs repo migrate --to=16`. ''; }; } diff --git a/pkgs/by-name/ku/kubo/package.nix b/pkgs/by-name/ku/kubo/package.nix index fc6930a8dfe7..5d18579daba1 100644 --- a/pkgs/by-name/ku/kubo/package.nix +++ b/pkgs/by-name/ku/kubo/package.nix @@ -8,15 +8,15 @@ buildGoModule rec { pname = "kubo"; - version = "0.36.0"; # When updating, also check if the repo version changed and adjust repoVersion below + version = "0.37.0"; # When updating, also check if the repo version changed and adjust repoVersion below rev = "v${version}"; - passthru.repoVersion = "16"; # Also update kubo-migrator when changing the repo version + passthru.repoVersion = "17"; # Kubo makes changes to its source tarball that don't match the git source. src = fetchurl { url = "https://github.com/ipfs/kubo/releases/download/${rev}/kubo-source.tar.gz"; - hash = "sha256-JbWt6d1cX3F2lmivjszcxcyE+wKYk+Sy03xhb4E3oHw="; + hash = "sha256-/7yWGxqqbiUajkWF5/YL/HUpH0/aevutQwy70VJuieA="; }; # tarball contains multiple files/directories From b8f0ee5c0c22bb3879459271232e74b195e5c287 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Sun, 19 Oct 2025 15:08:25 +0200 Subject: [PATCH 3/3] kubo: 0.37.0 -> 0.38.2 https://github.com/ipfs/kubo/releases/tag/v0.38.0 https://github.com/ipfs/kubo/releases/tag/v0.38.1 https://github.com/ipfs/kubo/releases/tag/v0.38.2 --- pkgs/by-name/ku/kubo/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ku/kubo/package.nix b/pkgs/by-name/ku/kubo/package.nix index 5d18579daba1..70636ced3a48 100644 --- a/pkgs/by-name/ku/kubo/package.nix +++ b/pkgs/by-name/ku/kubo/package.nix @@ -8,15 +8,15 @@ buildGoModule rec { pname = "kubo"; - version = "0.37.0"; # When updating, also check if the repo version changed and adjust repoVersion below + version = "0.38.2"; # When updating, also check if the repo version changed and adjust repoVersion below rev = "v${version}"; - passthru.repoVersion = "17"; + passthru.repoVersion = "18"; # Kubo makes changes to its source tarball that don't match the git source. src = fetchurl { url = "https://github.com/ipfs/kubo/releases/download/${rev}/kubo-source.tar.gz"; - hash = "sha256-/7yWGxqqbiUajkWF5/YL/HUpH0/aevutQwy70VJuieA="; + hash = "sha256-A02edHUZoU2oQk4OyCmc/wMfk3k+EWkdO2RxPGlUrXg="; }; # tarball contains multiple files/directories