nushellPlugins.formats: refactor

This commit is contained in:
Tom van Dijk
2025-06-28 00:36:35 +02:00
parent d22a7867e0
commit 7095018016
2 changed files with 8 additions and 13 deletions

View File

@@ -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;
};
}
})

View File

@@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec {
tag = version;
hash = "sha256-V1RKZ0Tqq0LTGbHS2lLMyf6M4AgAgWSzkDeFUighO4k=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-UbqKfQxut+76yB9F1gT8FEapbX/kHvaShltHpWUdhgc=";
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];