From 4627382fe2363d99f5e8fbb77eae0fd80a089fe3 Mon Sep 17 00:00:00 2001 From: Tom van Dijk <18gatenmaker6@gmail.com> Date: Sat, 28 Jun 2025 01:02:29 +0200 Subject: [PATCH] nushellPlugins.polars: refactor --- pkgs/shells/nushell/plugins/polars.nix | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/pkgs/shells/nushell/plugins/polars.nix b/pkgs/shells/nushell/plugins/polars.nix index 1811f3520fe5..e51a89ddcf58 100644 --- a/pkgs/shells/nushell/plugins/polars.nix +++ b/pkgs/shells/nushell/plugins/polars.nix @@ -8,33 +8,29 @@ nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "nushell_plugin_polars"; inherit (nushell) version src cargoHash; - useFetchCargoVendor = true; - nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; buildInputs = [ openssl ]; - cargoBuildFlags = [ "--package nu_plugin_polars" ]; - checkPhase = '' - # test failed without enough columns - cargo test --manifest-path crates/nu_plugin_polars/Cargo.toml -- \ - --skip=dataframe::command::core::to_repr::test::test_examples - ''; + buildAndTestSubdir = "crates/nu_plugin_polars"; + + checkFlags = [ + "--skip=dataframe::command::core::to_repr::test::test_examples" + ]; 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; { + meta = { description = "Nushell dataframe plugin commands based on polars"; mainProgram = "nu_plugin_polars"; - homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_polars"; - license = licenses.mit; - maintainers = with maintainers; [ joaquintrinanes ]; - platforms = with platforms; all; + homepage = "https://github.com/nushell/nushell/tree/${finalAttrs.version}/crates/nu_plugin_polars"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ joaquintrinanes ]; }; -} +})