depot/third_party/nixpkgs/pkgs/shells/nushell/plugins/query.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

51 lines
1.2 KiB
Nix

{
stdenv,
lib,
rustPlatform,
nushell,
IOKit,
CoreFoundation,
nix-update-script,
pkg-config,
openssl,
curl,
}:
rustPlatform.buildRustPackage {
pname = "nushell_plugin_query";
inherit (nushell) version src;
cargoHash = "sha256-7E4CCs4xyNGwjk6B2CwIFf1x0o5uNQArZpyxXEKLXMI=";
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
buildInputs =
[
openssl
curl
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
IOKit
CoreFoundation
];
cargoBuildFlags = [ "--package nu_plugin_query" ];
checkPhase = ''
cargo test --manifest-path crates/nu_plugin_query/Cargo.toml
'';
passthru.updateScript = nix-update-script {
# Skip the version check and only check the hash because we inherit version from nushell.
extraArgs = [ "--version=skip" ];
};
meta = with lib; {
description = "Nushell plugin to query JSON, XML, and various web data";
mainProgram = "nu_plugin_query";
homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_query";
license = licenses.mit;
maintainers = with maintainers; [
happysalada
aidalgol
];
platforms = with platforms; all;
};
}