From 0700b31ff7ede7fcee9b3035147874faaa70442e Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Mon, 8 Jun 2020 18:18:18 -0500 Subject: [PATCH] libgen-cli: install completions --- pkgs/tools/misc/libgen-cli/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/libgen-cli/default.nix b/pkgs/tools/misc/libgen-cli/default.nix index 7afc6c7f098..7d66941c99a 100644 --- a/pkgs/tools/misc/libgen-cli/default.nix +++ b/pkgs/tools/misc/libgen-cli/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: buildGoModule rec { pname = "libgen-cli"; version = "1.0.6"; @@ -14,6 +14,15 @@ buildGoModule rec { subPackages = [ "." ]; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + for shell in bash zsh; do + $out/bin/libgen-cli completion $shell > libgen-cli.$shell || : + installShellCompletion libgen-cli.$shell + done + ''; + meta = with lib; { homepage = "https://github.com/ciehanski/libgen-cli"; description =