modules/nvim-treesitter: fix extra grammars

This commit is contained in:
Dmitriy Pleshevskiy 2024-05-10 22:28:55 +03:00
parent 8d76150a25
commit 8495dc730f
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2

View file

@ -1,14 +1,14 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let let
inherit (builtins) elem attrNames; inherit (builtins) attrNames;
inherit (lib.nix2lua) pipe1 require call0 set; inherit (lib.nix2lua) pipe1 require call0 set;
cfg = config.plugins.style.nvim-treesitter; cfg = config.plugins.style.nvim-treesitter;
treesitterWithGrammars = (cfg.treesitter.package.override { treesitterWithGrammars = (cfg.treesitter.package.override {
inherit (cfg) extraGrammars; inherit (cfg) extraGrammars;
}).withPlugins (lib.filterAtttrs (k: elem k (attrNames cfg.extraGrammars))); }).withPlugins (p: map (k: p.${k}) (attrNames cfg.extraGrammars));
nvimTreeSitterWithBuiltinGrammars = nvimTreeSitterWithBuiltinGrammars =
if cfg.grammars == null then cfg.package.withAllGrammars if cfg.grammars == null then cfg.package.withAllGrammars
@ -35,7 +35,6 @@ let
'' ''
)) ))
); );
}); });
in in
{ {