packages/nvim-treesitter-nightly: init

this took way too long because i didn't realise .withPlugins only
overrides the original one aaaaaaa
This commit is contained in:
LavaDesu 2021-11-24 22:04:50 +07:00
parent ed5c719ff7
commit e2ee6940ab
Signed by: cilly
GPG key ID: 6500251E087653C9
5 changed files with 46 additions and 1 deletions

View file

@ -0,0 +1,26 @@
{
inputs,
tree-sitter,
vimPlugins
}:
let
nvim-treesitter-nightly = vimPlugins.nvim-treesitter.overrideAttrs(_: {
pname = "nvim-treesitter-nightly";
version = inputs.nvim-treesitter.lastModifiedDate;
src = inputs.nvim-treesitter;
});
in nvim-treesitter-nightly.overrideAttrs(o: {
passthru = o.passthru // {
unwrapped = nvim-treesitter-nightly;
withPlugins = grammarFn: nvim-treesitter-nightly.overrideAttrs (_: {
postPatch =
let
grammars = tree-sitter.withPlugins grammarFn;
in
''
rm -r parser
ln -s ${grammars} parser
'';
});
};
})