2022-01-30 17:06:58 +01:00
|
|
|
{ pkgs ? import ../../../third_party { }, ... }:
|
2020-12-19 19:22:55 +01:00
|
|
|
let
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
treeSitterGrammars = pkgs.runCommandLocal "grammars" { } ''
|
2020-12-19 19:22:55 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
${lib.concatStringsSep "\n"
|
|
|
|
(lib.mapAttrsToList (name: src: "ln -s ${src}/parser $out/bin/${name}.so") pkgs.tree-sitter.builtGrammars)};
|
|
|
|
'';
|
|
|
|
|
2022-01-30 17:06:58 +01:00
|
|
|
in
|
|
|
|
pkgs.mkShell {
|
2020-12-19 19:22:55 +01:00
|
|
|
buildInputs = [
|
|
|
|
pkgs.tree-sitter.builtGrammars.python
|
|
|
|
];
|
|
|
|
TREE_SITTER_GRAMMAR_DIR = treeSitterGrammars;
|
|
|
|
}
|