about summary refs log tree commit diff
path: root/pkgs/development/tools/sq
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2022-03-05 01:55:43 +0100
committerRaito Bezarius <masterancpp@gmail.com>2022-04-02 21:48:06 +0200
commit9f19ba380e63700f03304edcd2cc6b027ad4c65f (patch)
tree8f22210c31ece8b228a924130eb7f8ffca95329e /pkgs/development/tools/sq
parent0a4ef1dae9c8a9f46f5ca088bda99c06d9472e9f (diff)
sq: init at 0.15.4
Diffstat (limited to 'pkgs/development/tools/sq')
-rw-r--r--pkgs/development/tools/sq/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/development/tools/sq/default.nix b/pkgs/development/tools/sq/default.nix
new file mode 100644
index 0000000000000..4141fd59733ca
--- /dev/null
+++ b/pkgs/development/tools/sq/default.nix
@@ -0,0 +1,42 @@
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testVersion, sq }:
+buildGoModule rec {
+  pname = "sq";
+  version = "0.15.4";
+
+  src = fetchFromGitHub {
+    owner = "neilotoole";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-4CINLOHUVXQ+4e5I1fMqog6LubMm8RnbFmeuBOwALaw=";
+  };
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  vendorSha256 = "sha256-lNpWXKtnzwySzinNPxAKuaLqweWuS6zz8s2W4xXWlqM=";
+
+  # Some tests violates sandbox constraints.
+  doCheck = false;
+
+  ldflags = [
+    "-s" "-w" "-X github.com/neilotoole/sq/cli/buildinfo.Version=${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 = testVersion { package = sq; };
+  };
+
+  meta = with lib; {
+    description = "Swiss army knife for data";
+    homepage = "https://sq.io/";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ raitobezarius ];
+  };
+}