From 2e5baee20b53d4bc6901e7a08b9bd070f255ae2c Mon Sep 17 00:00:00 2001 From: Tom van Dijk <18gatenmaker6@gmail.com> Date: Sat, 28 Jun 2025 01:10:10 +0200 Subject: [PATCH] nushellPlugins.query: refactor --- pkgs/shells/nushell/plugins/query.nix | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pkgs/shells/nushell/plugins/query.nix b/pkgs/shells/nushell/plugins/query.nix index a24718377116..b99bf1ad8d3e 100644 --- a/pkgs/shells/nushell/plugins/query.nix +++ b/pkgs/shells/nushell/plugins/query.nix @@ -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; }; -} +})