nushellPlugins.highlight: refactor

(cherry picked from commit 17144a68f2)
This commit is contained in:
Tom van Dijk
2025-06-28 00:50:39 +02:00
parent c2fcc21741
commit 8b531b8118

View File

@@ -7,36 +7,29 @@
fetchFromGitHub,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "nushell_plugin_highlight";
version = "1.4.5+0.104.0";
src = fetchFromGitHub {
repo = "nu-plugin-highlight";
owner = "cptpiepmatz";
rev = "refs/tags/v${version}";
repo = "nu-plugin-highlight";
tag = "v${finalAttrs.version}";
hash = "sha256-B2CkdftlxczA6KHJsNmbPH7Grzq4MG7r6CRMvVTMkzQ=";
fetchSubmodules = true;
};
useFetchCargoVendor = true;
cargoHash = "sha256-3bLATtK9r4iVpxdbg5eCvzeGpIqWMl/GTDGCORuQfgY=";
nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
cargoBuildFlags = [ "--package nu_plugin_highlight" ];
checkPhase = ''
cargo test
'';
passthru.updateScript = nix-update-script { };
meta = with lib; {
meta = {
description = "A nushell plugin for syntax highlighting.";
mainProgram = "nu_plugin_highlight";
homepage = "https://github.com/cptpiepmatz/nu-plugin-highlight";
license = licenses.mit;
maintainers = with maintainers; [ mgttlinger ];
platforms = with platforms; all;
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ mgttlinger ];
};
}
})