depot/third_party/nixpkgs/pkgs/tools/networking/globalping-cli/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

38 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, nix-update-script }:
buildGoModule rec {
pname = "globalping-cli";
version = "1.2.1";
src = fetchFromGitHub {
owner = "jsdelivr";
repo = pname;
rev = "v${version}";
hash = "sha256-9FMp3cGJr8RdySZvSflYa91uaIV5wVl6WmUDvbRkSFY=";
};
vendorHash = "sha256-3VqCgkyhPKk5iBkKOK2EajEKgEnCHOQjO59AKFafQHc=";
nativeBuildInputs = [ installShellFiles ];
CGO_ENABLED = 0;
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
postInstall = ''
mv $out/bin/${pname} $out/bin/globalping
installShellCompletion --cmd globalping \
--bash <($out/bin/globalping completion bash) \
--fish <($out/bin/globalping completion fish) \
--zsh <($out/bin/globalping completion zsh)
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
description = "Simple CLI tool to run networking commands remotely from hundreds of globally distributed servers";
homepage = "https://www.jsdelivr.com/globalping/cli";
license = licenses.mpl20;
maintainers = with maintainers; [ xyenon ];
mainProgram = "globalping";
};
}