git.iko.soy/typeable/nixpkgs
on master help sign in
expenses: install shell completion
commit4a46547008f47672262ced00c0862b42b2c8f81f authorlegendofmiracles <legendofmiracles@protonmail.com> dateMon 24 Jan 2022, 08:54 (5 years ago) parent9f786de
1 file changed+10−1
pkgs/applications/misc/expenses/default.nix+10−1
pkgs/applications/misc/expenses/default.nix+10−1
@@ -1,8 +1,8 @@
11{ lib
2−
32, buildGoModule
43, fetchFromGitHub
54, sqlite
5+, installShellFiles
66}:
77
88buildGoModule rec {
@@ -21,12 +21,21 @@ buildGoModule rec {
2121 # package does not contain any tests as of v0.2.3
2222 doCheck = false;
2323
24+ nativeBuildInputs = [ installShellFiles ];
25+
2426 buildInputs = [ sqlite ];
2527
2628 ldflags = [
2729 "-s" "-w" "-X github.com/manojkarthick/expenses/cmd.Version=${version}"
2830 ];
2931
32+ postInstall = ''
33+ installShellCompletion --cmd expenses \
34+ --bash <($out/bin/expenses completion bash) \
35+ --zsh <($out/bin/expenses completion zsh) \
36+ --fish <($out/bin/expenses completion fish)
37+ '';
38+
3039 meta = with lib; {
3140 description = "An interactive command line expense logger";
3241 license = licenses.mit;