neovim: expose derivations instead of just src (#503437)

This commit is contained in:
Matthieu Coudron
2026-03-26 13:01:22 +00:00
committed by GitHub
+26 -20
View File
@@ -123,18 +123,31 @@ stdenv.mkDerivation (
inherit lua;
treesitter-parsers =
treesitter-parsers
// {
markdown = treesitter-parsers.markdown // {
location = "tree-sitter-markdown";
};
}
// {
markdown_inline = treesitter-parsers.markdown // {
language = "markdown_inline";
location = "tree-sitter-markdown-inline";
};
};
lib.mapAttrs
(
language: grammar:
tree-sitter.buildGrammar {
inherit (grammar) src;
version = "neovim-${finalAttrs.version}";
language = grammar.language or language;
location = grammar.location or null;
}
)
(
treesitter-parsers
// {
markdown = treesitter-parsers.markdown // {
location = "tree-sitter-markdown";
};
}
// {
markdown_inline = treesitter-parsers.markdown // {
language = "markdown_inline";
location = "tree-sitter-markdown-inline";
};
}
);
buildInputs = [
libuv
@@ -226,14 +239,7 @@ stdenv.mkDerivation (
+ lib.concatStrings (
lib.mapAttrsToList (language: grammar: ''
ln -s \
${
tree-sitter.buildGrammar {
inherit (grammar) src;
version = "neovim-${finalAttrs.version}";
language = grammar.language or language;
location = grammar.location or null;
}
}/parser \
${grammar}/parser \
$out/lib/nvim/parser/${language}.so
'') finalAttrs.treesitter-parsers
);