From c2fcc21741d015cfb113aec9505bb44b6eb81175 Mon Sep 17 00:00:00 2001 From: Tom van Dijk <18gatenmaker6@gmail.com> Date: Sat, 28 Jun 2025 00:36:35 +0200 Subject: [PATCH] nushellPlugins.formats: refactor (cherry picked from commit 7095018016f35d90c1bc65c2829bb36d0aec76c6) --- pkgs/shells/nushell/plugins/formats.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pkgs/shells/nushell/plugins/formats.nix b/pkgs/shells/nushell/plugins/formats.nix index 5a9b2cc03e0d..82a056b96073 100644 --- a/pkgs/shells/nushell/plugins/formats.nix +++ b/pkgs/shells/nushell/plugins/formats.nix @@ -7,32 +7,27 @@ nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "nushell_plugin_formats"; inherit (nushell) version src cargoHash; - useFetchCargoVendor = true; nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; - cargoBuildFlags = [ "--package nu_plugin_formats" ]; - checkPhase = '' - cargo test --manifest-path crates/nu_plugin_formats/Cargo.toml - ''; + buildAndTestSubdir = "crates/nu_plugin_formats"; 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 = "Formats plugin for Nushell"; mainProgram = "nu_plugin_formats"; - homepage = "https://github.com/nushell/nushell/tree/${version}/crates/nu_plugin_formats"; - license = licenses.mit; - maintainers = with maintainers; [ + homepage = "https://github.com/nushell/nushell/tree/${finalAttrs.version}/crates/nu_plugin_formats"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ viraptor aidalgol ]; - platforms = with platforms; all; }; -} +})