Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cfspeedtest";
version = "1.4.1";
src = fetchFromGitHub {
owner = "code-inflation";
repo = "cfspeedtest";
tag = "v${finalAttrs.version}";
hash = "sha256-MWHZllH0QVylmvwEwCX2uhNSEx9p5xEeW0u/zGyjNZE=";
};
cargoHash = "sha256-wTytRbue26KVaGb3LarTCNdq56psIayVDul4iQkwH2s=";
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";
changelog = "https://github.com/code-inflation/cfspeedtest/releases/tag/${finalAttrs.src.tag}";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [
colemickens
stepbrobd
];
mainProgram = "cfspeedtest";
};
})