From f4828b40fde0b39afc5dc9b147baa60cb2a6ca47 Mon Sep 17 00:00:00 2001 From: figsoda Date: Wed, 16 Nov 2022 12:54:49 -0500 Subject: [PATCH] vimPlugins.nvim-treesitter: use lib.concatMapAttrs --- .../vim/plugins/nvim-treesitter/overrides.nix | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix b/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix index 97218844730f..f5e5556eaee2 100644 --- a/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix +++ b/pkgs/applications/editors/vim/plugins/nvim-treesitter/overrides.nix @@ -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;