vimPlugins.nvim-treesitter: use lib.concatMapAttrs

This commit is contained in:
figsoda 2022-11-16 12:54:49 -05:00
parent f993f8a186
commit f4828b40fd

View File

@ -14,18 +14,18 @@ let
# ocaml-interface
# tree-sitter-ocaml-interface
# tree-sitter-ocaml_interface
builtGrammars = generatedGrammars // lib.listToAttrs
(lib.concatLists (lib.mapAttrsToList
(k: v:
let
replaced = lib.replaceStrings [ "_" ] [ "-" ] k;
in
map (lib.flip lib.nameValuePair v)
([ "tree-sitter-${k}" ] ++ lib.optionals (k != replaced) [
replaced
"tree-sitter-${replaced}"
]))
generatedDerivations));
builtGrammars = generatedGrammars // lib.concatMapAttrs
(k: v:
let
replaced = lib.replaceStrings [ "_" ] [ "-" ] k;
in
{
"tree-sitter-${k}" = v;
} // lib.optionalAttrs (k != replaced) {
${replaced} = v;
"tree-sitter-${replaced}" = v;
})
generatedDerivations;
allGrammars = lib.attrValues generatedDerivations;