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,
|
helpers,
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
|
options,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.plugins.nvim-tree;
|
cfg = config.plugins.nvim-tree;
|
||||||
inherit (helpers) ifNonNull';
|
|
||||||
|
|
||||||
openWinConfigOption =
|
openWinConfigOption =
|
||||||
helpers.defaultNullOpts.mkAttributeSet
|
helpers.defaultNullOpts.mkAttributeSet
|
||||||
|
@ -46,11 +46,6 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
iconsPackage = lib.mkPackageOption pkgs [
|
|
||||||
"vimPlugins"
|
|
||||||
"nvim-web-devicons"
|
|
||||||
] { nullable = true; };
|
|
||||||
|
|
||||||
gitPackage = lib.mkPackageOption pkgs "git" {
|
gitPackage = lib.mkPackageOption pkgs "git" {
|
||||||
nullable = true;
|
nullable = true;
|
||||||
};
|
};
|
||||||
|
@ -929,7 +924,7 @@ in
|
||||||
|
|
||||||
config =
|
config =
|
||||||
let
|
let
|
||||||
options =
|
setupOptions =
|
||||||
with cfg;
|
with cfg;
|
||||||
{
|
{
|
||||||
disable_netrw = disableNetrw;
|
disable_netrw = disableNetrw;
|
||||||
|
@ -1168,9 +1163,22 @@ in
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
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 = [
|
extraPlugins = [
|
||||||
cfg.package
|
cfg.package
|
||||||
] ++ lib.optional (cfg.iconsPackage != null) cfg.iconsPackage;
|
];
|
||||||
|
|
||||||
autoCmd =
|
autoCmd =
|
||||||
(optional autoOpenEnabled {
|
(optional autoOpenEnabled {
|
||||||
|
@ -1187,7 +1195,7 @@ in
|
||||||
(optionalString autoOpenEnabled openNvimTreeFunction)
|
(optionalString autoOpenEnabled openNvimTreeFunction)
|
||||||
+ ''
|
+ ''
|
||||||
|
|
||||||
require('nvim-tree').setup(${helpers.toLuaObject options})
|
require('nvim-tree').setup(${helpers.toLuaObject setupOptions})
|
||||||
'';
|
'';
|
||||||
|
|
||||||
extraPackages = [ cfg.gitPackage ];
|
extraPackages = [ cfg.gitPackage ];
|
||||||
|
|
|
@ -104,6 +104,7 @@
|
||||||
nvim-tree.enable = true;
|
nvim-tree.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
web-devicons.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{
|
{
|
||||||
empty = {
|
empty = {
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
plugins.nvim-tree.enable = true;
|
plugins.nvim-tree.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
defaults = {
|
defaults = {
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
plugins.nvim-tree = {
|
plugins.nvim-tree = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -258,9 +260,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
no-packages = {
|
no-packages = {
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
plugins.nvim-tree = {
|
plugins.nvim-tree = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconsPackage = null;
|
|
||||||
gitPackage = null;
|
gitPackage = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue