Skip to content

Commit

Permalink
glab: install shell completions (NixOS#168166)
Browse files Browse the repository at this point in the history
* glab: install shell completions

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

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
  • Loading branch information
nagy and SuperSandro2000 authored Apr 15, 2022
1 parent 8023ab5 commit ac83e58
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, stdenv }:

buildGoModule rec {
pname = "glab";
Expand All @@ -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;
Expand Down

0 comments on commit ac83e58

Please sign in to comment.