2023-07-15 17:15:38 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, getent, coreutils, nix-update-script, stdenv }:
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "otel-cli";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.4.1";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "equinix-labs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-kOTReHG7byOqKsaVrXXNq9DAyawTz4hUeR4Q5lJKmiM=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
vendorHash = "sha256-HwbEqWtOqiTe5Z/MtMAs63Lzvll/vgmbCpMTREXgtXA=";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
ln -s $GOPATH/bin/otel-cli .
|
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
substituteInPlace main_test.go \
|
2023-07-15 17:15:38 +00:00
|
|
|
--replace 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`'
|
2022-12-28 21:21:41 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
passthru.updateScript = nix-update-script {};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/equinix-labs/otel-cli";
|
|
|
|
description = "A command-line tool for sending OpenTelemetry traces";
|
|
|
|
changelog = "https://github.com/equinix-labs/otel-cli/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ emattiza urandom ];
|
|
|
|
};
|
|
|
|
}
|