From d22ac6c35e9b8336c0a826f0966d434ed3cca0b9 Mon Sep 17 00:00:00 2001 From: Merlin Humml Date: Tue, 8 Oct 2024 09:32:35 +0200 Subject: [PATCH] nushellPlugins.highlight: init at 1.3.1+0.98.0 --- pkgs/shells/nushell/plugins/default.nix | 1 + pkgs/shells/nushell/plugins/highlight.nix | 40 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 pkgs/shells/nushell/plugins/highlight.nix diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index e791e39274850..5cfa7c3ed3ff6 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -8,4 +8,5 @@ lib.makeScope newScope (self: with self; { regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release."; net = callPackage ./net.nix { inherit IOKit CoreFoundation; }; units = callPackage ./units.nix { }; + highlight = callPackage ./highlight.nix { }; }) diff --git a/pkgs/shells/nushell/plugins/highlight.nix b/pkgs/shells/nushell/plugins/highlight.nix new file mode 100644 index 0000000000000..19f70ca8d81eb --- /dev/null +++ b/pkgs/shells/nushell/plugins/highlight.nix @@ -0,0 +1,40 @@ +{ + stdenv, + lib, + rustPlatform, + pkg-config, + nix-update-script, + fetchFromGitHub, +}: + +rustPlatform.buildRustPackage rec { + pname = "nushell_plugin_highlight"; + version = "1.3.1+0.98.0"; + + src = fetchFromGitHub { + repo = "nu-plugin-highlight"; + owner = "cptpiepmatz"; + rev = "v${version}"; + hash = "sha256-G669d13JBLdy/1RUXtgZkiQhjgn3SqV34VlLbQoVOzc="; + }; + cargoHash = "sha256-ZZyxRiAaazLIwWtl9f30yp94HiKao3ZlYJ6B/vK14jc="; + + nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; + buildInputs = [ ]; + cargoBuildFlags = [ "--package nu_plugin_highlight" ]; + + checkPhase = '' + cargo test + ''; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "A nushell plugin that will inspect a file and return information based on it's magic number."; + mainProgram = "nu_plugin_highlight"; + homepage = "https://github.com/cptpiepmatz/nu-plugin-highlight"; + license = licenses.mit; + maintainers = with maintainers; [ mgttlinger ]; + platforms = with platforms; all; + }; +}