2021-01-15 06:42:41 +01:00
|
|
|
{ lib
|
2021-01-08 10:17:12 +01:00
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, sqlite
|
2022-01-24 15:54:13 +01:00
|
|
|
, installShellFiles
|
2021-01-08 10:17:12 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "expenses";
|
2022-01-24 10:19:18 +01:00
|
|
|
version = "0.2.3";
|
2021-01-08 10:17:12 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "manojkarthick";
|
|
|
|
repo = "expenses";
|
|
|
|
rev = "v${version}";
|
2022-01-24 10:19:18 +01:00
|
|
|
sha256 = "sha256-sqsogF2swMvYZL7Kj+ealrB1AAgIe7ZXXDLRdHL6Q+0=";
|
2021-01-08 10:17:12 +01:00
|
|
|
};
|
|
|
|
|
2023-09-13 06:44:46 +02:00
|
|
|
vendorHash = "sha256-rIcwZUOi6bdfiWZEsRF4kl1reNPPQNuBPHDOo7RQgYo=";
|
2021-01-08 10:17:12 +01:00
|
|
|
|
2022-01-24 10:19:18 +01:00
|
|
|
# package does not contain any tests as of v0.2.3
|
2021-01-08 10:17:12 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
2022-01-24 15:54:13 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-01-08 10:17:12 +01:00
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
|
2021-08-26 08:45:51 +02:00
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X github.com/manojkarthick/expenses/cmd.Version=${version}"
|
2021-01-08 10:17:12 +01:00
|
|
|
];
|
|
|
|
|
2022-01-24 15:54:13 +01:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd expenses \
|
|
|
|
--bash <($out/bin/expenses completion bash) \
|
|
|
|
--zsh <($out/bin/expenses completion zsh) \
|
|
|
|
--fish <($out/bin/expenses completion fish)
|
|
|
|
'';
|
|
|
|
|
2021-01-15 06:42:41 +01:00
|
|
|
meta = with lib; {
|
2021-01-08 10:17:12 +01:00
|
|
|
description = "An interactive command line expense logger";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.manojkarthick ];
|
2024-02-11 03:19:15 +01:00
|
|
|
mainProgram = "expenses";
|
2021-01-08 10:17:12 +01:00
|
|
|
};
|
|
|
|
}
|