nushellPlugins.query: refactor

This commit is contained in:
Tom van Dijk
2025-06-28 01:10:10 +02:00
parent 4627382fe2
commit 2e5baee20b

View File

@@ -9,21 +9,17 @@
curl,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "nushell_plugin_query";
inherit (nushell) version src cargoHash;
useFetchCargoVendor = true;
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
buildInputs = [
openssl
curl
];
cargoBuildFlags = [ "--package nu_plugin_query" ];
checkPhase = ''
cargo test --manifest-path crates/nu_plugin_query/Cargo.toml
'';
buildAndTestSubdir = "crates/nu_plugin_query";
passthru.updateScript = nix-update-script {
# Skip the version check and only check the hash because we inherit version from nushell.
@@ -33,12 +29,11 @@ rustPlatform.buildRustPackage rec {
meta = {
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";
homepage = "https://github.com/nushell/nushell/tree/${finalAttrs.version}/crates/nu_plugin_query";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
happysalada
aidalgol
];
platforms = lib.platforms.all;
};
}
})