expenses: install shell completion

This commit is contained in:
legendofmiracles 2022-01-24 08:54:13 -06:00
parent 9f786dea83
commit 4a46547008
No known key found for this signature in database
GPG Key ID: 19B082B3DEFE5451

View File

@ -1,8 +1,8 @@
{ lib
, buildGoModule
, fetchFromGitHub
, sqlite
, installShellFiles
}:
buildGoModule rec {
@ -21,12 +21,21 @@ buildGoModule rec {
# package does not contain any tests as of v0.2.3
doCheck = false;
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ sqlite ];
ldflags = [
"-s" "-w" "-X github.com/manojkarthick/expenses/cmd.Version=${version}"
];
postInstall = ''
installShellCompletion --cmd expenses \
--bash <($out/bin/expenses completion bash) \
--zsh <($out/bin/expenses completion zsh) \
--fish <($out/bin/expenses completion fish)
'';
meta = with lib; {
description = "An interactive command line expense logger";
license = licenses.mit;