plugins/barbar: iconsPackage -> icons provider options

This commit is contained in:
Austin Horstman 2024-09-20 10:18:39 -05:00
parent 23a903f13c
commit 2cf80fd66f
No known key found for this signature in database
3 changed files with 32 additions and 9 deletions

View file

@ -1,6 +1,7 @@
{ {
config,
lib, lib,
pkgs, options,
... ...
}: }:
with lib; 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 ++ (map
( (
@ -195,11 +207,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
); );
extraOptions = { extraOptions = {
iconsPackage = lib.mkPackageOption pkgs [
"vimPlugins"
"nvim-web-devicons"
] { nullable = true; };
keymaps = mapAttrs ( keymaps = mapAttrs (
optionName: funcName: optionName: funcName:
mkNullOrOption' { mkNullOrOption' {
@ -217,7 +224,18 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
}; };
extraConfig = cfg: { 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) ( keymaps = filter (keymap: keymap != null) (
# TODO: switch to `attrValues cfg.keymaps` when removing the deprecation warnings above: # TODO: switch to `attrValues cfg.keymaps` when removing the deprecation warnings above:

View file

@ -139,6 +139,7 @@
}; };
}; };
barbar.enable = true; barbar.enable = true;
web-devicons.enable = true;
}; };
globals.mapleader = " "; globals.mapleader = " ";

View file

@ -1,9 +1,11 @@
{ {
empty = { empty = {
plugins.web-devicons.enable = true;
plugins.barbar.enable = true; plugins.barbar.enable = true;
}; };
keymappings = { keymappings = {
plugins.web-devicons.enable = true;
plugins.barbar = { plugins.barbar = {
enable = true; enable = true;
@ -20,6 +22,7 @@
}; };
defaults = { defaults = {
plugins.web-devicons.enable = true;
plugins.barbar = { plugins.barbar = {
enable = true; enable = true;
@ -113,6 +116,7 @@
}; };
readme-example = { readme-example = {
plugins.web-devicons.enable = true;
plugins.barbar = { plugins.barbar = {
enable = true; enable = true;
@ -220,10 +224,10 @@
}; };
}; };
no-packages = { no-icons = {
plugins.web-devicons.enable = false;
plugins.barbar = { plugins.barbar = {
enable = true; enable = true;
iconsPackage = null;
settings.icons.filetype.enabled = false; settings.icons.filetype.enabled = false;
}; };
}; };