diff --git a/pkgs/by-name/xf/xfr/package.nix b/pkgs/by-name/xf/xfr/package.nix new file mode 100644 index 000000000000..ba28136c9743 --- /dev/null +++ b/pkgs/by-name/xf/xfr/package.nix @@ -0,0 +1,57 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + installShellFiles, + versionCheckHook, + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "xfr"; + version = "0.9.6"; + + src = fetchFromGitHub { + owner = "lance0"; + repo = "xfr"; + tag = "v${finalAttrs.version}"; + hash = "sha256-wYhwDSL9C4rtWgkhaXimk3u03c9UHj2O9eEe8pRlj6c="; + }; + + cargoHash = "sha256-f8m5vFNk62iXyK1Sh3Dda0pV6rUNErymS6QxiCuZ8DA="; + + nativeBuildInputs = [ + installShellFiles + versionCheckHook + ]; + doInstallCheck = true; + + postInstall = '' + installShellCompletion --cmd xfr \ + --bash <($out/bin/xfr --completions bash) \ + --fish <($out/bin/xfr --completions fish) \ + --zsh <($out/bin/xfr --completions zsh) + ''; + + passthru = { + updateScript = nix-update-script { }; + }; + + __structuredAttrs = true; + + meta = { + description = "Modern iperf3 alternative with a live TUI, multi-client server, and QUIC support."; + mainProgram = "xfr"; + homepage = "https://github.com/lance0/xfs"; + changelog = "https://github.com/lance0/xfr/releases/tag/v${finalAttrs.version}"; + maintainers = with lib.maintainers; [ + _0x4A6F + herbetom + ]; + license = with lib.licenses; [ + asl20 + mit + ]; + platforms = lib.platforms.linux; + }; +})