diff --git a/plugins/lsp/trouble.nix b/plugins/lsp/trouble.nix index f3a405a9..42383b9d 100644 --- a/plugins/lsp/trouble.nix +++ b/plugins/lsp/trouble.nix @@ -11,8 +11,6 @@ helpers.neovim-plugin.mkNeovimPlugin config { originalName = "trouble-nvim"; defaultPackage = pkgs.vimPlugins.trouble-nvim; - extraPlugins = with pkgs.vimPlugins; [ nvim-web-devicons ]; - maintainers = [ maintainers.loicreynier ]; # TODO introduced 2024-03-15: remove 2024-05-15 @@ -302,4 +300,15 @@ helpers.neovim-plugin.mkNeovimPlugin config { Enabling this will use the signs defined in your lsp client ''; }; + + extraOptions = { + iconsPackage = helpers.mkPackageOption { + name = "nvim-web-devicons"; + default = pkgs.vimPlugins.nvim-web-devicons; + }; + }; + + extraConfig = cfg: { + extraPlugins = mkIf (cfg.iconsPackage != null) [ cfg.iconsPackage ]; + }; } diff --git a/tests/test-sources/plugins/lsp/trouble.nix b/tests/test-sources/plugins/lsp/trouble.nix index 2ddffe48..c3296183 100644 --- a/tests/test-sources/plugins/lsp/trouble.nix +++ b/tests/test-sources/plugins/lsp/trouble.nix @@ -77,4 +77,11 @@ }; }; }; + + no-packages = { + plugins.trouble = { + enable = true; + iconsPackage = null; + }; + }; }