From 38cfa2e7cc73b3be42e4af05fed97dd95d950da3 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 31 Jul 2024 13:32:37 -0500 Subject: [PATCH] revive: ensure go is on the PATH at runtime This is needed due to https://github.com/mgechev/revive/pull/993. --- pkgs/development/tools/revive/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/revive/default.nix b/pkgs/development/tools/revive/default.nix index e08e2876c8fa0c3..a22fc7101e2ef8d 100644 --- a/pkgs/development/tools/revive/default.nix +++ b/pkgs/development/tools/revive/default.nix @@ -1,4 +1,4 @@ -{ buildGoModule, fetchFromGitHub, lib }: +{ buildGoModule, fetchFromGitHub, go, lib, makeWrapper }: buildGoModule rec { pname = "revive"; @@ -33,6 +33,15 @@ buildGoModule rec { ldflags+=" -X 'github.com/mgechev/revive/cli.date=$(cat DATE)'" ''; + allowGoReference = true; + + nativeBuildInputs = [ makeWrapper ]; + + postFixup = '' + wrapProgram $out/bin/revive \ + --prefix PATH : ${lib.makeBinPath [ go ]} + ''; + # The following tests fail when built by nix: # # $ nix log /nix/store/build-revive.1.3.9.drv | grep FAIL