plugins/trouble: iconsPackage -> icons provider options

This commit is contained in:
Austin Horstman 2024-09-20 13:21:20 -05:00
parent b2929765ab
commit 2e281c43e0
No known key found for this signature in database
3 changed files with 34 additions and 11 deletions

View file

@ -1,7 +1,8 @@
{
config,
lib,
helpers,
pkgs,
options,
...
}:
with lib;
@ -12,6 +13,20 @@ helpers.neovim-plugin.mkNeovimPlugin {
maintainers = [ maintainers.loicreynier ];
# TODO: added 2024-09-20 remove after 24.11
imports = [
(lib.mkRemovedOptionModule
[
"plugins"
"trouble"
"iconsPackage"
]
''
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
''
)
];
# TODO introduced 2024-03-15: remove 2024-05-15
optionsRenamedToSettings = [
"autoClose"
@ -300,14 +315,18 @@ helpers.neovim-plugin.mkNeovimPlugin {
'';
};
extraOptions = {
iconsPackage = lib.mkPackageOption pkgs [
"vimPlugins"
"nvim-web-devicons"
] { nullable = true; };
};
extraConfig = cfg: {
extraPlugins = mkIf (cfg.iconsPackage != null) [ cfg.iconsPackage ];
# TODO: added 2024-09-20 remove after 24.11
plugins.web-devicons = mkIf (
!(
config.plugins.mini.enable
&& config.plugins.mini.modules ? icons
&& config.plugins.mini.mockDevIcons
)
) { enable = mkOverride 1490 true; };
warnings = optional (options.plugins.web-devicons.enable.highestPrio == 1490) ''
Nixvim (plugins.trouble) `web-devicons` automatic installation is deprecated.
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
'';
};
}

View file

@ -164,6 +164,7 @@
};
};
};
web-devicons.enable = true;
};
};

View file

@ -1,9 +1,11 @@
{
empty = {
plugins.web-devicons.enable = true;
plugins.trouble.enable = true;
};
lsp = {
plugins.web-devicons.enable = true;
plugins.lsp = {
enable = true;
servers.clangd.enable = true;
@ -13,6 +15,7 @@
};
defaults = {
plugins.web-devicons.enable = true;
plugins.trouble = {
enable = true;
@ -78,10 +81,10 @@
};
};
no-packages = {
no-icons = {
plugins.web-devicons.enable = false;
plugins.trouble = {
enable = true;
iconsPackage = null;
};
};
}