Some checks failed
CI / check (push) Has been cancelled
Add graphify, a tool that turns any folder of code, docs, papers, images, or videos into a queryable knowledge graph for AI coding assistants. Includes tree-sitter grammar filtering to use only grammars available in nixpkgs, with missing grammars falling back to runtime downloads.
84 lines
2.1 KiB
Nix
84 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
python3Packages,
|
|
fetchFromGitHub,
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "graphifyy";
|
|
version = "0.7.10";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "safishamsi";
|
|
repo = "graphify";
|
|
rev = "v${version}";
|
|
hash = "sha256-sSlmYPDwY43ro+kd5uQyvE9cEPNAMXUd5TIEPcaoioc=";
|
|
};
|
|
|
|
build-system = with python3Packages; [
|
|
setuptools
|
|
];
|
|
|
|
# Only tree-sitter grammars available in nixpkgs are included.
|
|
# Missing grammars will be downloaded by tree-sitter at runtime on demand.
|
|
dependencies = with python3Packages; [
|
|
networkx
|
|
datasketch
|
|
rapidfuzz
|
|
tree-sitter
|
|
tree-sitter-python
|
|
tree-sitter-javascript
|
|
tree-sitter-rust
|
|
tree-sitter-c-sharp
|
|
tree-sitter-sql
|
|
];
|
|
|
|
# Remove unavailable tree-sitter grammars from pyproject.toml
|
|
postPatch = ''
|
|
sed -i \
|
|
-e '/"tree-sitter-typescript"/d' \
|
|
-e '/"tree-sitter-go"/d' \
|
|
-e '/"tree-sitter-java"/d' \
|
|
-e '/"tree-sitter-groovy"/d' \
|
|
-e '/"tree-sitter-c"/d' \
|
|
-e '/"tree-sitter-cpp"/d' \
|
|
-e '/"tree-sitter-ruby"/d' \
|
|
-e '/"tree-sitter-kotlin"/d' \
|
|
-e '/"tree-sitter-scala"/d' \
|
|
-e '/"tree-sitter-php"/d' \
|
|
-e '/"tree-sitter-swift"/d' \
|
|
-e '/"tree-sitter-lua"/d' \
|
|
-e '/"tree-sitter-zig"/d' \
|
|
-e '/"tree-sitter-powershell"/d' \
|
|
-e '/"tree-sitter-elixir"/d' \
|
|
-e '/"tree-sitter-objc"/d' \
|
|
-e '/"tree-sitter-julia"/d' \
|
|
-e '/"tree-sitter-verilog"/d' \
|
|
-e '/"tree-sitter-fortran"/d' \
|
|
pyproject.toml
|
|
'';
|
|
|
|
doCheck = false;
|
|
pythonImportsCheck = [ "graphify" ];
|
|
|
|
passthru = {
|
|
category = "AI Coding Agents";
|
|
updateScript = [
|
|
"nix-update"
|
|
"--flake"
|
|
".#graphify"
|
|
"--version=branch=main"
|
|
];
|
|
};
|
|
|
|
meta = {
|
|
description = "AI coding assistant skill - turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph";
|
|
homepage = "https://github.com/safishamsi/graphify";
|
|
changelog = "https://github.com/safishamsi/graphify/releases/tag/v${version}";
|
|
license = lib.licenses.mit;
|
|
mainProgram = "graphify";
|
|
platforms = lib.platforms.all;
|
|
};
|
|
}
|