depot/third_party/nixpkgs/pkgs/by-name/te/terraform-plugin-docs/package.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

61 lines
1.4 KiB
Nix

{ lib
, buildGoModule
, fetchFromGitHub
, makeWrapper
, go
, testers
, terraform-plugin-docs
, nix-update-script
}:
buildGoModule rec {
pname = "terraform-plugin-docs";
version = "0.19.4";
src = fetchFromGitHub {
owner = "hashicorp";
repo = "terraform-plugin-docs";
rev = "refs/tags/v${version}";
sha256 = "sha256-UEF+CsY302AJApDhnrPoTo09EcR/VOo10bXSf0XgtZk=";
};
vendorHash = "sha256-ZSHCP0eZWCvSObbUOSl0ohiiX79MyGC2ALowzvMXMv4=";
nativeBuildInputs = [ makeWrapper ];
subPackages = [
"cmd/tfplugindocs"
];
allowGoReference = true;
CGO_ENABLED = 0;
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.commit=${src.rev}"
];
postInstall = ''
wrapProgram $out/bin/tfplugindocs --prefix PATH : ${lib.makeBinPath [ go ]}
'';
passthru = {
tests.version = testers.testVersion {
command = "tfplugindocs --version";
package = terraform-plugin-docs;
};
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Generate and validate Terraform plugin/provider documentation";
homepage = "https://github.com/hashicorp/terraform-plugin-docs";
changelog = "https://github.com/hashicorp/terraform-plugin-docs/releases/tag/v${version}";
license = licenses.mpl20;
mainProgram = "tfplugindocs";
maintainers = with maintainers; [ lewo ];
};
}