Unverified Commit dcb886fb authored by Anthony Roussel's avatar Anthony Roussel
Browse files

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

parent 3ac34032
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
{ 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";