From ca9f18df45cfcfafabf9d7b27a3de8ffb492e6e3 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 2 Aug 2020 04:20:00 -0500 Subject: [PATCH] jx: install completions --- pkgs/applications/networking/cluster/jx/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/jx/default.nix b/pkgs/applications/networking/cluster/jx/default.nix index 5ae6ddf906f..320c9c7d98e 100644 --- a/pkgs/applications/networking/cluster/jx/default.nix +++ b/pkgs/applications/networking/cluster/jx/default.nix @@ -1,4 +1,4 @@ -{ buildGoModule, fetchFromGitHub, lib }: +{ buildGoModule, fetchFromGitHub, lib, installShellFiles }: buildGoModule rec { pname = "jx"; @@ -15,12 +15,21 @@ buildGoModule rec { subPackages = [ "cmd/jx" ]; + nativeBuildInputs = [ installShellFiles ]; + buildFlagsArray = '' -ldflags= -X github.com/jenkins-x/jx/pkg/version.Version=${version} -X github.com/jenkins-x/jx/pkg/version.Revision=${version} ''; + postInstall = '' + for shell in bash zsh; do + $out/bin/jx completion $shell > jx.$shell + installShellCompletion jx.$shell + done + ''; + meta = with lib; { description = "JX is a command line tool for installing and using Jenkins X."; homepage = "https://jenkins-x.io";