{ tree-sitter, grammarFileTypes, ... }:
{ nvim-treesitter, ... }:
let
treesitterGrammars = tree-sitter.withPlugins
(grammars: map (ft: grammars."tree-sitter-${ft}") grammarFileTypes);
nvim-treesitter-with-grammars = nvim-treesitter.overrideAttrs (oldAttrs: {
postPatch = ''
rm -r parser
ln -s ${treesitterGrammars} parser
'';
});
in
{
luaConfig = builtins.readFile ./treesitter.lua;
plugins = [
nvim-treesitter-with-grammars
];
}