Skip to content

Commit

Permalink
vimPlugins.nvim-treesitter: use lib.concatMapAttrs
Browse files Browse the repository at this point in the history
  • Loading branch information
figsoda committed Nov 17, 2022
1 parent f993f8a commit f4828b4
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f4828b4

Please sign in to comment.