Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2
3buildGoModule rec {
4 pname = "qc";
5 version = "0.5.1";
6
7 src = fetchFromGitHub {
8 owner = "qownnotes";
9 repo = "qc";
10 rev = "v${version}";
11 hash = "sha256-SrvcRF2yRGGPTk835ykG+NH9WPoc/bXO5tSj43Q7T3g=";
12 };
13
14 vendorHash = "sha256-7t5rQliLm6pMUHhtev/kNrQ7AOvmA/rR93SwNQhov6o=";
15
16 ldflags = [
17 "-s" "-w" "-X=github.com/qownnotes/qc/cmd.version=${version}"
18 ];
19
20 # There are no automated tests
21 doCheck = false;
22
23 subPackages = [ "." ];
24
25 nativeBuildInputs = [
26 installShellFiles
27 ];
28
29 postInstall = ''
30 export HOME=$(mktemp -d)
31 installShellCompletion --cmd qc \
32 --bash <($out/bin/qc completion bash) \
33 --fish <($out/bin/qc completion fish) \
34 --zsh <($out/bin/qc completion zsh)
35 '';
36
37 meta = with lib; {
38 description = "QOwnNotes command-line snippet manager";
39 mainProgram = "qc";
40 homepage = "https://github.com/qownnotes/qc";
41 license = licenses.mit;
42 maintainers = with maintainers; [ pbek totoroot ];
43 };
44}