plugins/treesitter: add iconsPackage

This commit is contained in:
Austin Horstman 2024-08-28 22:02:21 -05:00
parent bc7f4166f4
commit 4acf12c49d
No known key found for this signature in database
2 changed files with 18 additions and 5 deletions

View file

@ -324,6 +324,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
description = "Grammar packages to install"; description = "Grammar packages to install";
}; };
iconsPackage = helpers.mkPackageOption {
name = "nvim-web-devicons";
default = pkgs.vimPlugins.nvim-web-devicons;
};
# TODO: Implement rawLua support to be passed into extraConfigLua. # TODO: Implement rawLua support to be passed into extraConfigLua.
languageRegister = mkOption { languageRegister = mkOption {
type = with types; attrsOf (coercedTo str toList (listOf str)); type = with types; attrsOf (coercedTo str toList (listOf str));
@ -411,10 +416,11 @@ helpers.neovim-plugin.mkNeovimPlugin config {
extraFiles = mkIf cfg.nixvimInjections { "queries/nix/injections.scm".source = ./injections.scm; }; extraFiles = mkIf cfg.nixvimInjections { "queries/nix/injections.scm".source = ./injections.scm; };
extraPlugins = mkIf (cfg.package != null) [ extraPlugins =
(mkIf cfg.nixGrammars (cfg.package.withPlugins (_: cfg.grammarPackages))) lib.optional (cfg.iconsPackage != null) cfg.iconsPackage
(mkIf (!cfg.nixGrammars) cfg.package) ++ lib.optional (cfg.package != null) (
]; if cfg.nixGrammars then cfg.package.withPlugins (_: cfg.grammarPackages) else cfg.package
);
extraPackages = [ extraPackages = [
cfg.gccPackage cfg.gccPackage

View file

@ -134,4 +134,11 @@
}; };
}; };
}; };
no-icons = {
plugins.treesitter = {
enable = true;
iconsPackage = null;
};
};
} }