2023-02-09 11:40:11 +00:00
|
|
|
{ lib, bash, buildGoModule, fetchFromGitHub, getent, nix-update-script, stdenv }:
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "otel-cli";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "0.1.0";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "equinix-labs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-09 11:40:11 +00:00
|
|
|
hash = "sha256-iYlyokBAS5KQUYq83zhKWH/Vulq7prQdceFpeBJN2PI=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
vendorHash = "sha256-5c5uDp5KVo/DYAM5F76ivtT52+lNBheVmjAjmq6EJFk=";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
ln -s $GOPATH/bin/otel-cli .
|
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
substituteInPlace main_test.go \
|
|
|
|
--replace 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent ]}`'
|
|
|
|
'';
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|