Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
72 lines
1.7 KiB
Nix
72 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
buildGoModule,
|
|
fetchFromGitHub,
|
|
stdenv,
|
|
installShellFiles,
|
|
nix-update-script,
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "globalping-cli";
|
|
version = "1.5.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "jsdelivr";
|
|
repo = "globalping-cli";
|
|
rev = "v${version}";
|
|
hash = "sha256-UB2vYdyJ2+H8rFyJn1KBNnWoGUlRjwYorWXqoB9WDu0=";
|
|
};
|
|
|
|
vendorHash = "sha256-dJAuN5srL5EvMaRg8rHaTsurjYrdH45p965DeubpB0E=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
env.CGO_ENABLED = 0;
|
|
subPackages = [ "." ];
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.version=${version}"
|
|
];
|
|
|
|
preCheck = ''
|
|
export HOME="$TMPDIR"
|
|
'';
|
|
|
|
checkFlags =
|
|
let
|
|
skippedTests = [
|
|
# Skip tests that require network access
|
|
"Test_Authorize"
|
|
"Test_TokenIntrospection"
|
|
"Test_Logout"
|
|
"Test_RevokeToken"
|
|
"Test_Limits"
|
|
"Test_CreateMeasurement"
|
|
"Test_GetMeasurement"
|
|
];
|
|
in
|
|
[ "-skip=^${builtins.concatStringsSep "|^" skippedTests}" ];
|
|
|
|
postInstall = ''
|
|
mv $out/bin/globalping-cli $out/bin/globalping
|
|
''
|
|
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
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";
|
|
};
|
|
}
|