mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-31 15:30:27 +02:00
plugins: use mk{Neovim,Vim}Plugin's dependencies parameter
This commit is contained in:
parent
b66559d8ef
commit
1a64636839
49 changed files with 147 additions and 207 deletions
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
helpers,
|
||||
...
|
||||
}:
|
||||
|
@ -26,6 +27,25 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
'')
|
||||
];
|
||||
|
||||
dependencies =
|
||||
let
|
||||
defaults = config.plugins.spectre.settings.default;
|
||||
in
|
||||
[
|
||||
{
|
||||
name = "ripgrep";
|
||||
enable = defaults.find.cmd == "rg";
|
||||
}
|
||||
{
|
||||
name = "sed";
|
||||
enable = defaults.replace.cmd == "sed";
|
||||
}
|
||||
{
|
||||
name = "sd";
|
||||
enable = defaults.replace.cmd == "sd";
|
||||
}
|
||||
];
|
||||
|
||||
settingsOptions =
|
||||
let
|
||||
mkEngineOption =
|
||||
|
@ -230,16 +250,4 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
dependencies =
|
||||
let
|
||||
defaults = cfg.settings.default;
|
||||
in
|
||||
{
|
||||
ripgrep.enable = lib.mkIf (defaults.find.cmd == "rg") (lib.mkDefault true);
|
||||
sed.enable = lib.mkIf (defaults.replace.cmd == "sed") (lib.mkDefault true);
|
||||
sd.enable = lib.mkIf (defaults.replace.cmd == "sd") (lib.mkDefault true);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue