mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/diffview: iconsPackage -> icons provider options
This commit is contained in:
parent
cf13d60cd6
commit
7a3423ae18
2 changed files with 32 additions and 10 deletions
|
@ -3,6 +3,7 @@
|
||||||
helpers,
|
helpers,
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
options,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib;
|
with lib;
|
||||||
|
@ -80,6 +81,19 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# TODO: added 2024-09-20 remove after 24.11
|
||||||
|
imports = [
|
||||||
|
(lib.mkRemovedOptionModule
|
||||||
|
[
|
||||||
|
"plugins"
|
||||||
|
"diffview"
|
||||||
|
"iconsPackage"
|
||||||
|
]
|
||||||
|
''
|
||||||
|
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||||
|
''
|
||||||
|
)
|
||||||
|
];
|
||||||
options.plugins.diffview =
|
options.plugins.diffview =
|
||||||
with helpers.defaultNullOpts;
|
with helpers.defaultNullOpts;
|
||||||
helpers.neovim-plugin.extraOptionsOptions
|
helpers.neovim-plugin.extraOptionsOptions
|
||||||
|
@ -93,11 +107,6 @@ in
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
iconsPackage = lib.mkPackageOption pkgs [
|
|
||||||
"vimPlugins"
|
|
||||||
"nvim-web-devicons"
|
|
||||||
] { nullable = true; };
|
|
||||||
|
|
||||||
diffBinaries = mkBool false ''
|
diffBinaries = mkBool false ''
|
||||||
Show diffs for binaries
|
Show diffs for binaries
|
||||||
'';
|
'';
|
||||||
|
@ -827,9 +836,20 @@ in
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
mkIf cfg.enable {
|
mkIf cfg.enable {
|
||||||
extraPlugins = [
|
# TODO: added 2024-09-20 remove after 24.11
|
||||||
cfg.package
|
plugins.web-devicons = mkIf (
|
||||||
] ++ (optional (cfg.iconsPackage != null && cfg.useIcons) cfg.iconsPackage);
|
!(
|
||||||
|
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.diffview) `web-devicons` automatic installation is deprecated.
|
||||||
|
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||||
|
'';
|
||||||
|
|
||||||
|
extraPlugins = [ cfg.package ];
|
||||||
|
|
||||||
extraConfigLua = ''
|
extraConfigLua = ''
|
||||||
require("diffview").setup(${helpers.toLuaObject setupOptions})
|
require("diffview").setup(${helpers.toLuaObject setupOptions})
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{
|
{
|
||||||
empty = {
|
empty = {
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
plugins.diffview.enable = true;
|
plugins.diffview.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
example = {
|
example = {
|
||||||
|
plugins.web-devicons.enable = true;
|
||||||
plugins.diffview = {
|
plugins.diffview = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -162,10 +164,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
no-packages = {
|
no-icons = {
|
||||||
|
plugins.web-devicons.enable = false;
|
||||||
plugins.diffview = {
|
plugins.diffview = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconsPackage = null;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue