about summary refs log tree commit diff
path: root/pkgs/tools/misc/otel-cli
diff options
context:
space:
mode:
authorEvan Mattiza <nix@mattiza.dev>2021-10-28 19:42:51 +0000
committerColin Arnott <colin@urandom.co.uk>2022-12-19 08:21:24 +0000
commit56a9ace9335180b6702f039c770e561478f428db (patch)
treee85b2e8859c35251900c8b8b8d0c80137af41d9b /pkgs/tools/misc/otel-cli
parent292ee77c817b5b0d00d096e28a6cf9825dc5c466 (diff)
otel-cli: init at 0.0.20
Fixes #143471
Closes #143475
Diffstat (limited to 'pkgs/tools/misc/otel-cli')
-rw-r--r--pkgs/tools/misc/otel-cli/default.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/tools/misc/otel-cli/default.nix b/pkgs/tools/misc/otel-cli/default.nix
new file mode 100644
index 0000000000000..68d89d1a6e4a9
--- /dev/null
+++ b/pkgs/tools/misc/otel-cli/default.nix
@@ -0,0 +1,30 @@
+{ lib, bash, buildGoModule, fetchFromGitHub, getent, stdenv }:
+
+buildGoModule rec {
+  pname = "otel-cli";
+  version = "0.0.20";
+
+  src = fetchFromGitHub {
+    owner = "equinix-labs";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-bWdkuw0uEE75l9YCo2Dq1NpWXuMH61RQ6p7m65P1QCE=";
+  };
+
+  vendorHash = "sha256-IJ2Gq5z1oNvcpWPh+BMs46VZMN1lHyE+M7kUinTSRr8=";
+
+  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 ]}`'
+  '';
+
+  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 ];
+  };
+}