mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
plugins/barbar: iconsPackage -> icons provider options
This commit is contained in:
parent
23a903f13c
commit
2cf80fd66f
3 changed files with 32 additions and 9 deletions
|
@ -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:
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
};
|
||||
};
|
||||
barbar.enable = true;
|
||||
web-devicons.enable = true;
|
||||
};
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue