depot/pkgs/development/tools/sq/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

51 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, sq }:
buildGoModule rec {
pname = "sq";
version = "0.48.3";
src = fetchFromGitHub {
owner = "neilotoole";
repo = pname;
rev = "v${version}";
hash = "sha256-22N8DEaLmGBA3Rx6VzxplUK9UAydo/gx4EsQzzaRHNE=";
};
vendorHash = "sha256-p0r7TuWFpV81Rnxqdj+UJec60EmvVQISURe43SpOpw0=";
proxyVendor = true;
nativeBuildInputs = [ installShellFiles ];
# Some tests violates sandbox constraints.
doCheck = false;
ldflags = [
"-s"
"-w"
"-X=github.com/neilotoole/sq/cli/buildinfo.Version=v${version}"
];
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}";
};
};
meta = with lib; {
description = "Swiss army knife for data";
mainProgram = "sq";
homepage = "https://sq.io/";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ raitobezarius ];
};
}