fluxctl: install completions

This commit is contained in:
Mario Rodas 2020-08-10 04:20:00 -05:00
parent 32779e6dad
commit 1eaa19a33a
No known key found for this signature in database
GPG Key ID: 325649BCA6D53027
1 changed files with 10 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, buildGoModule, fetchFromGitHub }:
{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "fluxctl";
@ -13,10 +13,19 @@ buildGoModule rec {
vendorSha256 = "00qm45vfz4afj8f9hikrlk96w0rdzxqq2azhzrnzfymyiwc6jk5c";
nativeBuildInputs = [ installShellFiles ];
subPackages = [ "cmd/fluxctl" ];
buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
postInstall = ''
for shell in bash fish zsh; do
$out/bin/fluxctl completion $shell > fluxctl.$shell
installShellCompletion fluxctl.$shell
done
'';
meta = with stdenv.lib; {
description = "CLI client for Flux, the GitOps Kubernetes operator";
homepage = "https://github.com/fluxcd/flux";