mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/nvim-tree: iconsPackage -> icons provider options
This commit is contained in:
parent
e23bd5475c
commit
254b15d066
3 changed files with 21 additions and 10 deletions
|
@ -3,12 +3,12 @@
|
|||
helpers,
|
||||
pkgs,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.nvim-tree;
|
||||
inherit (helpers) ifNonNull';
|
||||
|
||||
openWinConfigOption =
|
||||
helpers.defaultNullOpts.mkAttributeSet
|
||||
|
@ -46,11 +46,6 @@ in
|
|||
];
|
||||
};
|
||||
|
||||
iconsPackage = lib.mkPackageOption pkgs [
|
||||
"vimPlugins"
|
||||
"nvim-web-devicons"
|
||||
] { nullable = true; };
|
||||
|
||||
gitPackage = lib.mkPackageOption pkgs "git" {
|
||||
nullable = true;
|
||||
};
|
||||
|
@ -929,7 +924,7 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
options =
|
||||
setupOptions =
|
||||
with cfg;
|
||||
{
|
||||
disable_netrw = disableNetrw;
|
||||
|
@ -1168,9 +1163,22 @@ in
|
|||
'';
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
# 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.nvim-tree) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
'';
|
||||
|
||||
extraPlugins = [
|
||||
cfg.package
|
||||
] ++ lib.optional (cfg.iconsPackage != null) cfg.iconsPackage;
|
||||
];
|
||||
|
||||
autoCmd =
|
||||
(optional autoOpenEnabled {
|
||||
|
@ -1187,7 +1195,7 @@ in
|
|||
(optionalString autoOpenEnabled openNvimTreeFunction)
|
||||
+ ''
|
||||
|
||||
require('nvim-tree').setup(${helpers.toLuaObject options})
|
||||
require('nvim-tree').setup(${helpers.toLuaObject setupOptions})
|
||||
'';
|
||||
|
||||
extraPackages = [ cfg.gitPackage ];
|
||||
|
|
|
@ -104,6 +104,7 @@
|
|||
nvim-tree.enable = true;
|
||||
};
|
||||
};
|
||||
web-devicons.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.web-devicons.enable = true;
|
||||
plugins.nvim-tree.enable = true;
|
||||
};
|
||||
|
||||
defaults = {
|
||||
plugins.web-devicons.enable = true;
|
||||
plugins.nvim-tree = {
|
||||
enable = true;
|
||||
|
||||
|
@ -258,9 +260,9 @@
|
|||
};
|
||||
|
||||
no-packages = {
|
||||
plugins.web-devicons.enable = true;
|
||||
plugins.nvim-tree = {
|
||||
enable = true;
|
||||
iconsPackage = null;
|
||||
gitPackage = null;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue