popeye: install shell completion

This commit is contained in:
Maxime Brunet 2024-02-23 12:48:29 -08:00
parent 899fe5550b
commit a33b9f25dd

View File

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "popeye";
@ -19,6 +19,15 @@ buildGoModule rec {
vendorHash = "sha256-Vt5QwggdasVk4j2huSIneBMemi3Q0R4MgZn2yNlOH5E=";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd popeye \
--bash <($out/bin/popeye completion bash) \
--fish <($out/bin/popeye completion fish) \
--zsh <($out/bin/popeye completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
$out/bin/popeye version | grep ${version} > /dev/null