From c617af9c0542fd9b01bfd3c92dd5f5417c73cdce Mon Sep 17 00:00:00 2001 From: happysalada Date: Wed, 5 Apr 2023 11:37:28 -0400 Subject: [PATCH] nushellPlugins.query: init at 0.78.0 --- pkgs/shells/nushell/plugins/default.nix | 5 ++++ pkgs/shells/nushell/plugins/query.nix | 35 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 3 files changed, 44 insertions(+) create mode 100644 pkgs/shells/nushell/plugins/default.nix create mode 100644 pkgs/shells/nushell/plugins/query.nix diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix new file mode 100644 index 000000000000..ad0e0f996a50 --- /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 000000000000..fb9ee11cba38 --- /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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 00de72fa70b6..744e76c6a46e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26819,6 +26819,10 @@ with pkgs; nu_scripts = callPackage ../shells/nushell/nu_scripts { }; + nushellPlugins = callPackage ../shells/nushell/plugins { + inherit (darwin.apple_sdk_11_0.frameworks) IOKit CoreFoundation; + }; + nettools = if stdenv.isLinux then callPackage ../os-specific/linux/net-tools { } else unixtools.nettools;