mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +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,
|
||||
config,
|
||||
pkgs,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
|
@ -80,6 +81,19 @@ let
|
|||
};
|
||||
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 =
|
||||
with helpers.defaultNullOpts;
|
||||
helpers.neovim-plugin.extraOptionsOptions
|
||||
|
@ -93,11 +107,6 @@ in
|
|||
];
|
||||
};
|
||||
|
||||
iconsPackage = lib.mkPackageOption pkgs [
|
||||
"vimPlugins"
|
||||
"nvim-web-devicons"
|
||||
] { nullable = true; };
|
||||
|
||||
diffBinaries = mkBool false ''
|
||||
Show diffs for binaries
|
||||
'';
|
||||
|
@ -827,9 +836,20 @@ in
|
|||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [
|
||||
cfg.package
|
||||
] ++ (optional (cfg.iconsPackage != null && cfg.useIcons) 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.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 = ''
|
||||
require("diffview").setup(${helpers.toLuaObject setupOptions})
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.web-devicons.enable = true;
|
||||
plugins.diffview.enable = true;
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.web-devicons.enable = true;
|
||||
plugins.diffview = {
|
||||
enable = true;
|
||||
|
||||
|
@ -162,10 +164,10 @@
|
|||
};
|
||||
};
|
||||
|
||||
no-packages = {
|
||||
no-icons = {
|
||||
plugins.web-devicons.enable = false;
|
||||
plugins.diffview = {
|
||||
enable = true;
|
||||
iconsPackage = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue