Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 fetchFromGitHub, 4 rustPlatform, 5 pkg-config, 6 openssl, 7}: 8 9rustPlatform.buildRustPackage rec { 10 pname = "code2prompt"; 11 version = "1.1.0"; 12 13 src = fetchFromGitHub { 14 owner = "mufeedvh"; 15 repo = "code2prompt"; 16 rev = "v${version}"; 17 hash = "sha256-KZqh0Vq4Mn56PhUO1JUzVpNBAGOZqUAsj31Cj5K+Lyk="; 18 }; 19 20 cargoLock = { 21 lockFile = ./Cargo.lock; 22 }; 23 24 postPatch = '' 25 # src is missing Cargo.lock 26 ln -s ${./Cargo.lock} Cargo.lock 27 ''; 28 29 nativeBuildInputs = [ pkg-config ]; 30 31 buildInputs = [ openssl ]; 32 33 meta = { 34 description = "CLI tool that converts your codebase into a single LLM prompt with a source tree, prompt templating, and token counting"; 35 homepage = "https://github.com/mufeedvh/code2prompt"; 36 license = lib.licenses.mit; 37 maintainers = with lib.maintainers; [ heisfer ]; 38 mainProgram = "code2prompt"; 39 }; 40}