Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
47 lines
1 KiB
Nix
47 lines
1 KiB
Nix
{
|
|
lib,
|
|
fetchFromGitHub,
|
|
rustPlatform,
|
|
pkg-config,
|
|
openssl,
|
|
stdenv,
|
|
darwin,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "code2prompt";
|
|
version = "1.1.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mufeedvh";
|
|
repo = "code2prompt";
|
|
rev = "v${version}";
|
|
hash = "sha256-KZqh0Vq4Mn56PhUO1JUzVpNBAGOZqUAsj31Cj5K+Lyk=";
|
|
};
|
|
|
|
cargoLock = {
|
|
lockFile = ./Cargo.lock;
|
|
};
|
|
|
|
postPatch = ''
|
|
# src is missing Cargo.lock
|
|
ln -s ${./Cargo.lock} Cargo.lock
|
|
'';
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs =
|
|
[ openssl ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
darwin.apple_sdk.frameworks.Security
|
|
darwin.apple_sdk.frameworks.AppKit
|
|
];
|
|
|
|
meta = {
|
|
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 = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [ heisfer ];
|
|
mainProgram = "code2prompt";
|
|
};
|
|
}
|