2023-05-24 13:37:59 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "qc";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.5.1";
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qownnotes";
|
|
|
|
repo = "qc";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-SrvcRF2yRGGPTk835ykG+NH9WPoc/bXO5tSj43Q7T3g=";
|
2023-05-24 13:37:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vendorHash = "sha256-7t5rQliLm6pMUHhtev/kNrQ7AOvmA/rR93SwNQhov6o=";
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s" "-w" "-X=github.com/qownnotes/qc/cmd.version=${version}"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# There are no automated tests
|
2023-05-24 13:37:59 +00:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
export HOME=$(mktemp -d)
|
2023-05-24 13:37:59 +00:00
|
|
|
installShellCompletion --cmd qc \
|
2023-07-15 17:15:38 +00:00
|
|
|
--bash <($out/bin/qc completion bash) \
|
|
|
|
--fish <($out/bin/qc completion fish) \
|
|
|
|
--zsh <($out/bin/qc completion zsh)
|
2023-05-24 13:37:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "QOwnNotes command-line snippet manager";
|
|
|
|
homepage = "https://github.com/qownnotes/qc";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ pbek totoroot ];
|
|
|
|
};
|
|
|
|
}
|