diff --git a/plugins/by-name/trouble/default.nix b/plugins/by-name/trouble/default.nix index f582d080..070eb1d5 100644 --- a/plugins/by-name/trouble/default.nix +++ b/plugins/by-name/trouble/default.nix @@ -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. + ''; }; } diff --git a/tests/test-sources/plugins/by-name/todo-comments/default.nix b/tests/test-sources/plugins/by-name/todo-comments/default.nix index 0d99e86c..4bdc2f9a 100644 --- a/tests/test-sources/plugins/by-name/todo-comments/default.nix +++ b/tests/test-sources/plugins/by-name/todo-comments/default.nix @@ -164,6 +164,7 @@ }; }; }; + web-devicons.enable = true; }; }; diff --git a/tests/test-sources/plugins/by-name/trouble/default.nix b/tests/test-sources/plugins/by-name/trouble/default.nix index c3296183..b12359c6 100644 --- a/tests/test-sources/plugins/by-name/trouble/default.nix +++ b/tests/test-sources/plugins/by-name/trouble/default.nix @@ -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; }; }; }