diff --git a/plugins/by-name/barbar/default.nix b/plugins/by-name/barbar/default.nix index 0d85cc3e..f08f6bfd 100644 --- a/plugins/by-name/barbar/default.nix +++ b/plugins/by-name/barbar/default.nix @@ -1,6 +1,7 @@ { + config, lib, - pkgs, + options, ... }: with lib; @@ -172,6 +173,17 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { ] ) ) + # TODO: added 2024-09-20 remove after 24.11 + (lib.mkRemovedOptionModule + [ + "plugins" + "barbar" + "iconsPackage" + ] + '' + Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead. + '' + ) ] ++ (map ( @@ -195,11 +207,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { ); extraOptions = { - iconsPackage = lib.mkPackageOption pkgs [ - "vimPlugins" - "nvim-web-devicons" - ] { nullable = true; }; - keymaps = mapAttrs ( optionName: funcName: mkNullOrOption' { @@ -217,7 +224,18 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin { }; 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.barbar) `web-devicons` automatic installation is deprecated. + Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead. + ''; keymaps = filter (keymap: keymap != null) ( # TODO: switch to `attrValues cfg.keymaps` when removing the deprecation warnings above: diff --git a/tests/test-sources/example-configurations/issues.nix b/tests/test-sources/example-configurations/issues.nix index 899e06f2..d87f91d5 100644 --- a/tests/test-sources/example-configurations/issues.nix +++ b/tests/test-sources/example-configurations/issues.nix @@ -139,6 +139,7 @@ }; }; barbar.enable = true; + web-devicons.enable = true; }; globals.mapleader = " "; diff --git a/tests/test-sources/plugins/by-name/barbar/default.nix b/tests/test-sources/plugins/by-name/barbar/default.nix index 72c2a17d..2c13d93f 100644 --- a/tests/test-sources/plugins/by-name/barbar/default.nix +++ b/tests/test-sources/plugins/by-name/barbar/default.nix @@ -1,9 +1,11 @@ { empty = { + plugins.web-devicons.enable = true; plugins.barbar.enable = true; }; keymappings = { + plugins.web-devicons.enable = true; plugins.barbar = { enable = true; @@ -20,6 +22,7 @@ }; defaults = { + plugins.web-devicons.enable = true; plugins.barbar = { enable = true; @@ -113,6 +116,7 @@ }; readme-example = { + plugins.web-devicons.enable = true; plugins.barbar = { enable = true; @@ -220,10 +224,10 @@ }; }; - no-packages = { + no-icons = { + plugins.web-devicons.enable = false; plugins.barbar = { enable = true; - iconsPackage = null; settings.icons.filetype.enabled = false; }; };