depot/pkgs/by-name/co/code2prompt/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

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";
};
}