nixpkgs/pkgs/development/tools/sq/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, sq }:
2022-12-27 01:06:49 +00:00
buildGoModule rec {
2022-03-05 00:55:43 +00:00
pname = "sq";
version = "0.46.1";
2022-03-05 00:55:43 +00:00
src = fetchFromGitHub {
owner = "neilotoole";
repo = pname;
rev = "v${version}";
hash = "sha256-TjJ3XDyHHZWMAYV5bJQffH4a9AheZWraov3d4HB/yno=";
2022-03-05 00:55:43 +00:00
};
vendorHash = "sha256-DIYSUIUHEiRv+pPZ2hE/2X4GmT3lvdWd/mkl1wbjID4=";
2022-03-05 00:55:43 +00:00
2022-12-27 01:06:49 +00:00
proxyVendor = true;
nativeBuildInputs = [ installShellFiles ];
2022-03-05 00:55:43 +00:00
# Some tests violates sandbox constraints.
doCheck = false;
ldflags = [
2022-12-27 01:06:49 +00:00
"-s"
"-w"
"-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}"
2022-03-05 00:55:43 +00:00
];
postInstall = ''
installShellCompletion --cmd sq \
--bash <($out/bin/sq completion bash) \
--fish <($out/bin/sq completion fish) \
--zsh <($out/bin/sq completion zsh)
'';
passthru.tests = {
version = testers.testVersion {
package = sq;
version = "v${version}";
};
2022-03-05 00:55:43 +00:00
};
meta = with lib; {
description = "Swiss army knife for data";
homepage = "https://sq.io/";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ raitobezarius ];
};
}