about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2025-01-21 22:22:44 +0100
committerAlan Pearce2025-01-21 22:22:44 +0100
commit8805ae08522e2192363814067dd44530582b488a (patch)
tree83e2ea053073d117c64e89f9bbdcc7a854e24d6f
parentbc4c8fb8ad92ca5770f0804499bdd1e1ba3bab9e (diff)
downloadnix-packages-main.tar.lz
nix-packages-main.tar.zst
nix-packages-main.zip
add go-instrument HEAD main
-rw-r--r--default.nix1
-rw-r--r--pkgs/go-instrument/default.nix29
2 files changed, 30 insertions, 0 deletions
diff --git a/default.nix b/default.nix
index 3d89820..262772e 100644
--- a/default.nix
+++ b/default.nix
@@ -14,6 +14,7 @@
   modules = import ./modules/nixos; # NixOS modules
   overlays = import ./overlays; # nixpkgs overlays
 
+  go-instrument = pkgs.callPackage ./pkgs/go-instrument { };
   htmlformat = pkgs.callPackage ./pkgs/htmlformat { };
   emacs-unlimited-select = pkgs.callPackage ./pkgs/emacs-unlimited-select { };
   porto = pkgs.callPackage ./pkgs/porto { };
diff --git a/pkgs/go-instrument/default.nix b/pkgs/go-instrument/default.nix
new file mode 100644
index 0000000..950032f
--- /dev/null
+++ b/pkgs/go-instrument/default.nix
@@ -0,0 +1,29 @@
+{
+  lib,
+  buildGoModule,
+  fetchFromGitHub,
+}:
+
+buildGoModule rec {
+  pname = "go-instrument";
+  version = "1.7.0";
+
+  src = fetchFromGitHub {
+    owner = "nikolaydubina";
+    repo = "go-instrument";
+    rev = "v${version}";
+    hash = "sha256-0WoID8hYtAu4EJbEgvHtJtE5keq33aGDMjFU9B+MLh8=";
+  };
+
+  vendorHash = "sha256-dofJA3Xxf68r4nKv6ocAYgnvOZD8eeezkaXLOqlRI6k=";
+
+  ldflags = [ "-s" "-w" ];
+
+  meta = {
+    description = "Automatically add Trace Spans to Go methods and functions";
+    homepage = "https://github.com/nikolaydubina/go-instrument";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ alanpearce ];
+    mainProgram = "go-instrument";
+  };
+}