terraform-docs: install shell completions (#347637)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
buildGoModule,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "terraform-docs";
|
||||
@@ -16,6 +18,17 @@ buildGoModule rec {
|
||||
|
||||
vendorHash = "sha256-aweKTHQBYYqSp8CymwhnVv1WNQ7cZ1/bJNz7DSo7PKc=";
|
||||
|
||||
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}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Utility to generate documentation from Terraform modules in various output formats";
|
||||
mainProgram = "terraform-docs";
|
||||
|
||||
Reference in New Issue
Block a user