From 17a36446ae44becb0abe2a54f404d6b6f7814409 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Tue, 13 Jun 2023 00:19:00 +0000 Subject: [PATCH] ytt: install completions --- pkgs/development/tools/ytt/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/ytt/default.nix b/pkgs/development/tools/ytt/default.nix index b75a78e57b59..8adf3a9d4e79 100644 --- a/pkgs/development/tools/ytt/default.nix +++ b/pkgs/development/tools/ytt/default.nix @@ -1,4 +1,5 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: + buildGoModule rec { pname = "ytt"; version = "0.45.3"; @@ -12,12 +13,21 @@ buildGoModule rec { vendorHash = null; + nativeBuildInputs = [ installShellFiles ]; + ldflags = [ "-X github.com/vmware-tanzu/carvel-ytt/pkg/version.Version=${version}" ]; subPackages = [ "cmd/ytt" ]; + postInstall = '' + installShellCompletion --cmd ytt \ + --bash <($out/bin/ytt completion bash) \ + --fish <($out/bin/ytt completion fish) \ + --zsh <($out/bin/ytt completion zsh) + ''; + meta = with lib; { description = "YAML templating tool that allows configuration of complex software via reusable templates with user-provided values"; homepage = "https://get-ytt.io";