Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, sq }: 2 3buildGoModule rec { 4 pname = "sq"; 5 version = "0.36.2"; 6 7 src = fetchFromGitHub { 8 owner = "neilotoole"; 9 repo = pname; 10 rev = "v${version}"; 11 sha256 = "sha256-EuNB39FcpkFHWgyQkOTqm5WUTEHHgmuqssM2qLycvTM="; 12 }; 13 14 vendorHash = "sha256-nzXYKV3pZToh9UzCTADpzZQNmfEAL4lshJmC/sj0zs0="; 15 16 proxyVendor = true; 17 18 nativeBuildInputs = [ installShellFiles ]; 19 20 # Some tests violates sandbox constraints. 21 doCheck = false; 22 23 ldflags = [ 24 "-s" 25 "-w" 26 "-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}" 27 ]; 28 29 postInstall = '' 30 installShellCompletion --cmd sq \ 31 --bash <($out/bin/sq completion bash) \ 32 --fish <($out/bin/sq completion fish) \ 33 --zsh <($out/bin/sq completion zsh) 34 ''; 35 36 passthru.tests = { 37 version = testers.testVersion { 38 package = sq; 39 version = "v${version}"; 40 }; 41 }; 42 43 meta = with lib; { 44 description = "Swiss army knife for data"; 45 homepage = "https://sq.io/"; 46 license = licenses.mit; 47 platforms = platforms.all; 48 maintainers = with maintainers; [ raitobezarius ]; 49 }; 50}