mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-01 21:04:30 +02:00
lib/{vim,neovim}-plugin: installPackage
-> packageDecorator
Replace `mkNeovimPlugin`'s `installPackage` parameter with a new internal module option: `packageDecorator`. The option is a function that applies some transformation to `cfg.package`'s value before it is installed.
This commit is contained in:
parent
1d78aee791
commit
de99f2938f
3 changed files with 30 additions and 10 deletions
|
@ -430,8 +430,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
# NOTE: We call setup manually below.
|
||||
callSetup = false;
|
||||
# NOTE: We install cfg.package manually so we can install grammars using it.
|
||||
installPackage = false;
|
||||
|
||||
extraConfig = cfg: {
|
||||
plugins.treesitter.luaConfig.content =
|
||||
|
@ -455,10 +453,10 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
extraFiles = mkIf cfg.nixvimInjections { "queries/nix/injections.scm".source = ./injections.scm; };
|
||||
|
||||
extraPlugins = mkIf (cfg.package != null) [
|
||||
(mkIf cfg.nixGrammars (cfg.package.withPlugins (_: cfg.grammarPackages)))
|
||||
(mkIf (!cfg.nixGrammars) cfg.package)
|
||||
];
|
||||
# Install the grammar packages if enabled
|
||||
plugins.treesitter.packageDecorator = lib.mkIf cfg.nixGrammars (
|
||||
pkg: pkg.withPlugins (_: cfg.grammarPackages)
|
||||
);
|
||||
|
||||
extraPackages = [
|
||||
cfg.gccPackage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue