Files
nixpkgs/pkgs/by-name/te/terraform-docs/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

60 lines
1.7 KiB
Nix

{
stdenv,
lib,
# Build fails with Go 1.25, with the following error:
# 'vendor/golang.org/x/tools/internal/tokeninternal/tokeninternal.go:64:9: invalid array length -delta * delta (constant -256 of type int64)'
# Wait for upstream to update their vendored dependencies before unpinning.
buildGo124Module,
fetchFromGitHub,
installShellFiles,
testers,
}:
buildGo124Module (finalAttrs: {
pname = "terraform-docs";
version = "0.20.0";
src = fetchFromGitHub {
owner = "terraform-docs";
repo = "terraform-docs";
tag = "v${finalAttrs.version}";
hash = "sha256-DiKoYAe7vcNy35ormKHYZcZrGK/MEb6VmcHWPgrbmUg=";
};
vendorHash = "sha256-ynyYpX41LJxGhf5kF2AULj+VKROjsvTjVPBnqG+JGSg=";
ldflags = [
"-s"
"-w"
];
env.CGO_ENABLED = 0;
excludedPackages = [ "scripts" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
$out/bin/terraform-docs completion bash >terraform-docs.bash
$out/bin/terraform-docs completion fish >terraform-docs.fish
$out/bin/terraform-docs completion zsh >terraform-docs.zsh
installShellCompletion terraform-docs.{bash,fish,zsh}
'';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
version = "v${finalAttrs.version}";
};
meta = with lib; {
description = "Utility to generate documentation from Terraform modules in various output formats";
mainProgram = "terraform-docs";
homepage = "https://github.com/terraform-docs/terraform-docs/";
license = licenses.mit;
maintainers = with maintainers; [
zimbatm
anthonyroussel
];
};
})