about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorhappysalada <raphael@megzari.com>2023-04-05 11:37:28 -0400
committerYt <happysalada@proton.me>2023-04-06 09:30:34 -0400
commitc617af9c0542fd9b01bfd3c92dd5f5417c73cdce (patch)
tree0a7384d8360c60049f1868fa04e01cdb19b85720 /pkgs/shells
parent642ee2373c7ecba2f7fb84de2e25af3151c154aa (diff)
nushellPlugins.query: init at 0.78.0
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/nushell/plugins/default.nix5
-rw-r--r--pkgs/shells/nushell/plugins/query.nix35
2 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix
new file mode 100644
index 0000000000000..ad0e0f996a50a
--- /dev/null
+++ b/pkgs/shells/nushell/plugins/default.nix
@@ -0,0 +1,5 @@
+{ lib, newScope, IOKit, CoreFoundation }:
+
+lib.makeScope newScope (self: with self; {
+  query = callPackage ./query.nix { inherit IOKit CoreFoundation; };
+})
diff --git a/pkgs/shells/nushell/plugins/query.nix b/pkgs/shells/nushell/plugins/query.nix
new file mode 100644
index 0000000000000..fb9ee11cba386
--- /dev/null
+++ b/pkgs/shells/nushell/plugins/query.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, lib
+, rustPlatform
+, nushell
+, nix-update-script
+, IOKit
+, CoreFoundation
+}:
+
+let
+  pname = "nushell_plugin_query";
+in
+rustPlatform.buildRustPackage {
+  inherit pname;
+  version = nushell.version;
+
+  src = nushell.src;
+
+  cargoHash = "sha256-tHTAz3/4EihdVGXAePCmcOUOjeaqjrY6fIESOGcCW/8=";
+
+  buildInputs = lib.optionals stdenv.isDarwin [ IOKit CoreFoundation ];
+
+  cargoBuildFlags = [ "--package nu_plugin_query" ];
+
+  # compilation fails with a missing symbol
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A Nushell plugin to query JSON, XML, and various web data";
+    homepage = "https://github.com/nushell/nushell/tree/main/crates/nu_plugin_query";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ happysalada ];
+    platforms = with platforms; all;
+  };
+}