{ lib, fetchFromGitHub, nix-update-script, rustPlatform, pkg-config, perl, openssl, }: rustPlatform.buildRustPackage rec { pname = "code2prompt"; version = "4.2.0"; src = fetchFromGitHub { owner = "mufeedvh"; repo = "code2prompt"; rev = "v${version}"; hash = "sha256-Gh8SsSTZW7QlyyC3SWJ5pOK2x85/GT7+LPJn2Jeczpc="; }; cargoLock = { lockFile = src + "/Cargo.lock"; }; buildAndTestSubdir = "crates/code2prompt"; nativeBuildInputs = [pkg-config perl]; buildInputs = [openssl]; passthru.updateScript = nix-update-script {}; meta = with lib; { description = "A CLI tool that converts your codebase into a single LLM prompt with a source tree, prompt templating, and token counting"; homepage = "https://github.com/mufeedvh/code2prompt"; license = licenses.mit; platforms = platforms.linux; mainProgram = "code2prompt"; }; }