diff --git a/pkgs/by-name/cf/cfspeedtest/package.nix b/pkgs/by-name/cf/cfspeedtest/package.nix index e4fe48bb2b10..c9decc92d1c0 100644 --- a/pkgs/by-name/cf/cfspeedtest/package.nix +++ b/pkgs/by-name/cf/cfspeedtest/package.nix @@ -3,28 +3,40 @@ stdenv, rustPlatform, fetchFromGitHub, + installShellFiles, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "cfspeedtest"; - version = "1.3.2"; + version = "1.3.4"; src = fetchFromGitHub { owner = "code-inflation"; repo = "cfspeedtest"; - tag = "v${version}"; - hash = "sha256-Q1K5UcrSckEN+6W9UO2u07R3mZ6+J8E1ZYRZqnXif1s="; + tag = "v${finalAttrs.version}"; + hash = "sha256-6ea9qOAFP7+1UIrGASFiAPyem+VDVgzrgD44ELsXRzc="; }; useFetchCargoVendor = true; - cargoHash = "sha256-moYovJamW9xX3niO10bG9K3choDMV3wtuUSCn/5g1Yw="; + cargoHash = "sha256-uyLd4KQa9zWMCuurpdQv0OnCSguE180dm6FzHR+nC40="; - meta = with lib; { + nativeBuildInputs = [ installShellFiles ]; + + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd cfspeedtest \ + --bash <($out/bin/cfspeedtest --generate-completion bash) \ + --fish <($out/bin/cfspeedtest --generate-completion fish) \ + --zsh <($out/bin/cfspeedtest --generate-completion zsh) + ''; + + meta = { description = "Unofficial CLI for speed.cloudflare.com"; homepage = "https://github.com/code-inflation/cfspeedtest"; - license = with licenses; [ mit ]; - broken = stdenv.hostPlatform.isDarwin; - maintainers = with maintainers; [ colemickens ]; + license = with lib.licenses; [ mit ]; + maintainers = with lib.maintainers; [ + colemickens + stepbrobd + ]; mainProgram = "cfspeedtest"; }; -} +})