vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / by-name / te / terraform-docs / package.nix
blob6a395109426f98fb2f72a54990525785ca159382
2   stdenv,
3   lib,
4   buildGoModule,
5   fetchFromGitHub,
6   installShellFiles,
7 }:
8 buildGoModule rec {
9   pname = "terraform-docs";
10   version = "0.18.0";
12   src = fetchFromGitHub {
13     owner = "terraform-docs";
14     repo = pname;
15     rev = "v${version}";
16     hash = "sha256-XZS+mGp2QsrKS3fPZd0ja4w/CAfPcyzSgwolQ+StER0=";
17   };
19   vendorHash = "sha256-aweKTHQBYYqSp8CymwhnVv1WNQ7cZ1/bJNz7DSo7PKc=";
21   excludedPackages = [ "scripts" ];
23   nativeBuildInputs = [ installShellFiles ];
25   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
26     $out/bin/terraform-docs completion bash >terraform-docs.bash
27     $out/bin/terraform-docs completion fish >terraform-docs.fish
28     $out/bin/terraform-docs completion zsh >terraform-docs.zsh
29     installShellCompletion terraform-docs.{bash,fish,zsh}
30   '';
32   meta = with lib; {
33     description = "Utility to generate documentation from Terraform modules in various output formats";
34     mainProgram = "terraform-docs";
35     homepage = "https://github.com/terraform-docs/terraform-docs/";
36     license = licenses.mit;
37     maintainers = with maintainers; [ zimbatm ];
38   };