about summary refs log tree commit diff
path: root/pkgs/development/tools/cobra-cli/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/cobra-cli/default.nix')
-rw-r--r--pkgs/development/tools/cobra-cli/default.nix18
1 files changed, 17 insertions, 1 deletions
diff --git a/pkgs/development/tools/cobra-cli/default.nix b/pkgs/development/tools/cobra-cli/default.nix
index 989c2f161f6d7..a3f277259f2bb 100644
--- a/pkgs/development/tools/cobra-cli/default.nix
+++ b/pkgs/development/tools/cobra-cli/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, makeWrapper, go }:
 
 buildGoModule rec {
   pname = "cobra-cli";
@@ -13,6 +13,22 @@ buildGoModule rec {
 
   vendorSha256 = "sha256-vrtGPQzY+NImOGaSxV+Dvch+GNPfL9XfY4lfCHTGXwY=";
 
+  nativeBuildInputs = [ makeWrapper ];
+
+  allowGoReference = true;
+
+  postPatch = ''
+    substituteInPlace "cmd/add_test.go" \
+      --replace "TestGoldenAddCmd" "SkipGoldenAddCmd"
+    substituteInPlace "cmd/init_test.go" \
+      --replace "TestGoldenInitCmd" "SkipGoldenInitCmd"
+  '';
+
+  postFixup = ''
+    wrapProgram "$out/bin/cobra-cli" \
+      --prefix PATH : ${go}/bin
+  '';
+
   meta = with lib; {
     description = "Cobra CLI tool to generate applications and commands";
     homepage = "https://github.com/spf13/cobra-cli/";