terraform-plugin-docs: ensure go is in the PATH

Co-authored-by: Philipp Böschen <catouc@philipp.boeschen.me>
This commit is contained in:
Anthony Roussel 2023-11-01 08:06:19 +01:00
parent 3ac3403256
commit dcb886fba7
No known key found for this signature in database
GPG key ID: 9DC4987B1A55E75E

View file

@ -1,6 +1,8 @@
{ lib
, buildGoModule
, fetchFromGitHub
, makeWrapper
, go
, testers
, terraform-plugin-docs
, nix-update-script
@ -19,10 +21,14 @@ buildGoModule rec {
vendorHash = "sha256-AjW6BokLVDkIWXToJ7wNq/g19xKTAfpQ/gVlKCV5qw0=";
nativeBuildInputs = [ makeWrapper ];
subPackages = [
"cmd/tfplugindocs"
];
allowGoReference = true;
CGO_ENABLED = 0;
ldflags = [
@ -32,6 +38,10 @@ buildGoModule rec {
"-X main.commit=${src.rev}"
];
postInstall = ''
wrapProgram $out/bin/tfplugindocs --prefix PATH : ${lib.makeBinPath [ go ]}
'';
passthru = {
tests.version = testers.testVersion {
command = "tfplugindocs --version";