{ stdenv, lib, rustPlatform, pkg-config, nix-update-script, fetchFromGitHub, IOKit, Foundation, }: rustPlatform.buildRustPackage rec { pname = "nushell_plugin_highlight"; version = "1.3.2+0.99.0"; src = fetchFromGitHub { repo = "nu-plugin-highlight"; owner = "cptpiepmatz"; rev = "refs/tags/v${version}"; hash = "sha256-rYS5Nqk+No1BhmEPzl+MX+aCH8fzHqdp8U8PKYSWVcc="; }; cargoHash = "sha256-VHx+DLS+v4p++KI+ZLzJpFk4A5Omwy6E0vJ/lgP3pC0="; nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ IOKit Foundation ]; 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; }; }