Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
buildGoModule,
fetchFromGitHub,
makeWrapper,
go,
testers,
terraform-plugin-docs,
nix-update-script,
}:
buildGoModule rec {
pname = "terraform-plugin-docs";
version = "0.23.0";
src = fetchFromGitHub {
owner = "hashicorp";
repo = "terraform-plugin-docs";
tag = "v${version}";
hash = "sha256-SIPGdY8wvM7Lfn0PAqbmk12fhJpq4CA/GYQppTYE8HY=";
};
vendorHash = "sha256-Dqc3B3wfAwX0M6T8TmQU7kjjECHVaK+YmW8H7ZTK+ao=";
nativeBuildInputs = [ makeWrapper ];
subPackages = [
"cmd/tfplugindocs"
];
allowGoReference = true;
env.CGO_ENABLED = 0;
ldflags = [
"-s"
"-w"
"-X github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs/build.version=${version}"
"-X github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs/build.commit=${src.tag}"
];
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 = {
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 = lib.licenses.mpl20;
mainProgram = "tfplugindocs";
maintainers = with lib.maintainers; [ lewo ];
};
}