lol
1{ lib, buildGoModule, fetchFromGitHub, getent, coreutils, nix-update-script, stdenv }:
2
3buildGoModule rec {
4 pname = "otel-cli";
5 version = "0.4.1";
6
7 src = fetchFromGitHub {
8 owner = "equinix-labs";
9 repo = pname;
10 rev = "v${version}";
11 hash = "sha256-kOTReHG7byOqKsaVrXXNq9DAyawTz4hUeR4Q5lJKmiM=";
12 };
13
14 vendorHash = "sha256-HwbEqWtOqiTe5Z/MtMAs63Lzvll/vgmbCpMTREXgtXA=";
15
16 preCheck = ''
17 ln -s $GOPATH/bin/otel-cli .
18 '' + lib.optionalString (!stdenv.isDarwin) ''
19 substituteInPlace main_test.go \
20 --replace 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`'
21 '';
22
23 passthru.updateScript = nix-update-script {};
24
25 meta = with lib; {
26 homepage = "https://github.com/equinix-labs/otel-cli";
27 description = "A command-line tool for sending OpenTelemetry traces";
28 changelog = "https://github.com/equinix-labs/otel-cli/releases/tag/v${version}";
29 license = licenses.asl20;
30 maintainers = with lib.maintainers; [ emattiza urandom ];
31 };
32}