glab: install shell completions (#168166)

* glab: install shell completions

* Update pkgs/applications/version-management/git-and-tools/glab/default.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Daniel Nagy 2022-04-15 19:15:34 +02:00 committed by GitHub
parent 8023ab5825
commit ac83e58d62
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, stdenv }:
buildGoModule rec {
pname = "glab";
@ -24,6 +24,15 @@ buildGoModule rec {
subPackages = [ "cmd/glab" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
installShellCompletion --cmd glab \
--bash <($out/bin/glab completion -s bash) \
--fish <($out/bin/glab completion -s fish) \
--zsh <($out/bin/glab completion -s zsh)
'';
meta = with lib; {
description = "An open-source GitLab command line tool";
license = licenses.mit;