mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
treewide: consolidate iconsPackage removal and warning
This commit is contained in:
parent
38a183564b
commit
b473bdc5ae
12 changed files with 64 additions and 208 deletions
|
@ -51,20 +51,6 @@ let
|
|||
};
|
||||
in
|
||||
{
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"alpha"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
options = {
|
||||
plugins.alpha = {
|
||||
enable = lib.mkEnableOption "alpha-nvim";
|
||||
|
@ -167,23 +153,11 @@ in
|
|||
lib.mkIf cfg.enable {
|
||||
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
warnings = lib.optionals opt.iconsEnabled.isDefined (
|
||||
[
|
||||
''
|
||||
The option definition `plugins.alpha.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it.
|
||||
''
|
||||
]
|
||||
++
|
||||
lib.optional
|
||||
(
|
||||
(opt.iconsEnabled.isDefined -> cfg.iconsEnabled)
|
||||
&& options.plugins.web-devicons.enable.highestPrio == 1490
|
||||
)
|
||||
''
|
||||
Nixvim (plugins.alpha) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
);
|
||||
warnings = lib.optionals opt.iconsEnabled.isDefined [
|
||||
''
|
||||
The option definition `plugins.alpha.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it.
|
||||
''
|
||||
];
|
||||
plugins.web-devicons =
|
||||
lib.mkIf
|
||||
(
|
||||
|
|
|
@ -173,17 +173,6 @@ 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
|
||||
(
|
||||
|
@ -232,10 +221,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
&& 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:
|
||||
|
|
|
@ -162,9 +162,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
(lib.mkRenamedOptionModule (oldHighlightsPath ++ [ "trunkMarker" ]) (
|
||||
newHighlightsPath ++ [ "trunc_marker" ]
|
||||
))
|
||||
(lib.mkRemovedOptionModule (basePluginPath ++ [ "iconsPackage" ]) ''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
'')
|
||||
]
|
||||
++ mkSettingsRenamedOptionModules basePluginPath optionsPath oldOptions
|
||||
++ mkSettingsRenamedOptionModules oldHighlightsPath newHighlightsPath oldHighlightOptions;
|
||||
|
@ -666,10 +663,7 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
&& config.plugins.mini.mockDevIcons
|
||||
)
|
||||
) { enable = lib.mkOverride 1490 true; };
|
||||
warnings = lib.optional (options.plugins.web-devicons.enable.highestPrio == 1490) ''
|
||||
Nixvim (plugins.bufferline) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
'';
|
||||
|
||||
opts.termguicolors = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -12,20 +12,6 @@ let
|
|||
mkListStr = helpers.defaultNullOpts.mkNullable (types.listOf types.str);
|
||||
in
|
||||
{
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"chadtree"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
options.plugins.chadtree = helpers.neovim-plugin.extraOptionsOptions // {
|
||||
enable = mkEnableOption "chadtree";
|
||||
|
||||
|
@ -526,17 +512,6 @@ in
|
|||
{
|
||||
enable = lib.mkOverride 1490 false;
|
||||
};
|
||||
warnings =
|
||||
optional
|
||||
(
|
||||
(cfg.theme == null || cfg.theme.iconGlyphSet == "devicons")
|
||||
|
||||
&& options.plugins.web-devicons.enable.highestPrio == 1490
|
||||
)
|
||||
''
|
||||
Nixvim (plugins.chadtree) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
'';
|
||||
|
||||
extraPlugins = [ cfg.package ];
|
||||
|
||||
|
|
|
@ -81,19 +81,6 @@ 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
|
||||
|
@ -844,10 +831,6 @@ in
|
|||
&& 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 ];
|
||||
|
||||
|
|
|
@ -38,20 +38,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
inherit settingsOptions settingsExample;
|
||||
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"fzf-lua"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
extraOptions = {
|
||||
fzfPackage = lib.mkPackageOption pkgs "fzf" {
|
||||
nullable = true;
|
||||
|
@ -122,23 +108,11 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
in
|
||||
{
|
||||
# TODO: deprecated 2024-08-29 remove after 24.11
|
||||
warnings = lib.optionals opt.iconsEnabled.isDefined (
|
||||
[
|
||||
''
|
||||
The option definition `plugins.fzf-lua.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it.
|
||||
''
|
||||
]
|
||||
++
|
||||
lib.optional
|
||||
(
|
||||
(opt.iconsEnabled.isDefined -> cfg.iconsEnabled)
|
||||
&& options.plugins.web-devicons.enable.highestPrio == 1490
|
||||
)
|
||||
''
|
||||
Nixvim (plugins.fzf-lua) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
);
|
||||
warnings = lib.optionals opt.iconsEnabled.isDefined [
|
||||
''
|
||||
The option definition `plugins.fzf-lua.iconsEnabled' in ${lib.showFiles opt.iconsEnabled.files} has been deprecated; please remove it.
|
||||
''
|
||||
];
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
plugins.web-devicons =
|
||||
lib.mkIf
|
||||
|
|
|
@ -44,20 +44,7 @@ in
|
|||
"keys"
|
||||
"borderStyle"
|
||||
"renamePromptPrefix"
|
||||
]
|
||||
++ [
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"lspsaga"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
];
|
||||
|
||||
options = {
|
||||
plugins.lspsaga = helpers.neovim-plugin.extraOptionsOptions // {
|
||||
|
@ -484,21 +471,11 @@ in
|
|||
{
|
||||
enable = mkOverride 1490 true;
|
||||
};
|
||||
warnings =
|
||||
lib.optional
|
||||
(
|
||||
(cfg.ui.devicon == null || cfg.ui.devicon)
|
||||
&& options.plugins.web-devicons.enable.highestPrio == 1490
|
||||
)
|
||||
''
|
||||
Nixvim (plugins.lspsaga) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
++ lib.optional (
|
||||
# https://nvimdev.github.io/lspsaga/implement/#default-options
|
||||
(isBool cfg.implement.enable && cfg.implement.enable)
|
||||
&& (isBool cfg.symbolInWinbar.enable && !cfg.symbolInWinbar.enable)
|
||||
) "You have enabled the `implement` module but it requires `symbolInWinbar` to be enabled.";
|
||||
warnings = lib.optional (
|
||||
# https://nvimdev.github.io/lspsaga/implement/#default-options
|
||||
(isBool cfg.implement.enable && cfg.implement.enable)
|
||||
&& (isBool cfg.symbolInWinbar.enable && !cfg.symbolInWinbar.enable)
|
||||
) "You have enabled the `implement` module but it requires `symbolInWinbar` to be enabled.";
|
||||
|
||||
extraPlugins = [ cfg.package ];
|
||||
extraConfigLua =
|
||||
|
|
|
@ -26,17 +26,6 @@ in
|
|||
(mkRemovedOptionModule (
|
||||
basePluginPath ++ [ "closeFloatsOnEscapeKey" ]
|
||||
) "This option has been removed from upstream.")
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"neo-tree"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
options.plugins.neo-tree =
|
||||
let
|
||||
|
@ -1145,10 +1134,6 @@ in
|
|||
&& config.plugins.mini.mockDevIcons
|
||||
)
|
||||
) { enable = mkOverride 1490 true; };
|
||||
warnings = optional (options.plugins.web-devicons.enable.highestPrio == 1490) ''
|
||||
Nixvim (plugins.neo-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
|
||||
|
|
|
@ -1171,10 +1171,6 @@ in
|
|||
&& 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
|
||||
|
|
|
@ -37,17 +37,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
]
|
||||
"This option no longer has any effect now that the `plugin.telescope.keymaps` implementation uses `<cmd>`."
|
||||
)
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"telescope"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
extraOptions = {
|
||||
|
@ -115,10 +104,6 @@ lib.nixvim.neovim-plugin.mkNeovimPlugin {
|
|||
&& config.plugins.mini.mockDevIcons
|
||||
)
|
||||
) { enable = mkOverride 1490 true; };
|
||||
warnings = optional (options.plugins.web-devicons.enable.highestPrio == 1490) ''
|
||||
Nixvim (plugins.telescope) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
'';
|
||||
|
||||
extraConfigVim = mkIf (cfg.highlightTheme != null) ''
|
||||
let $BAT_THEME = '${cfg.highlightTheme}'
|
||||
|
|
|
@ -13,20 +13,6 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
|
||||
maintainers = [ maintainers.loicreynier ];
|
||||
|
||||
# TODO: added 2024-09-20 remove after 24.11
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
"trouble"
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
)
|
||||
];
|
||||
|
||||
# TODO introduced 2024-03-15: remove 2024-05-15
|
||||
optionsRenamedToSettings = [
|
||||
"autoClose"
|
||||
|
@ -324,9 +310,5 @@ helpers.neovim-plugin.mkNeovimPlugin {
|
|||
&& config.plugins.mini.mockDevIcons
|
||||
)
|
||||
) { enable = mkOverride 1490 true; };
|
||||
warnings = optional (options.plugins.web-devicons.enable.highestPrio == 1490) ''
|
||||
Nixvim (plugins.trouble) `web-devicons` automatic installation is deprecated.
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,6 +14,21 @@ let
|
|||
# Added 2024-09-17
|
||||
surround = "vim-surround";
|
||||
};
|
||||
# Added 2024-09-21; remove after 24.11
|
||||
# `iconsPackage` options were briefly available in the following plugins for ~3 weeks
|
||||
iconsPackagePlugins = [
|
||||
"telescope"
|
||||
"lspsaga"
|
||||
"nvim-tree"
|
||||
"neo-tree"
|
||||
"trouble"
|
||||
"alpha"
|
||||
"diffview"
|
||||
"fzf-lua"
|
||||
"bufferline"
|
||||
"barbar"
|
||||
"chadtree"
|
||||
];
|
||||
in
|
||||
{
|
||||
|
||||
|
@ -36,5 +51,36 @@ in
|
|||
"plugins"
|
||||
new
|
||||
]
|
||||
) renamed);
|
||||
) renamed)
|
||||
++ builtins.map (
|
||||
name:
|
||||
lib.mkRemovedOptionModule
|
||||
[
|
||||
"plugins"
|
||||
name
|
||||
"iconsPackage"
|
||||
]
|
||||
''
|
||||
Please use `plugins.web-devicons` or `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons` instead.
|
||||
''
|
||||
) iconsPackagePlugins
|
||||
# Show a warning when web-devicons is auto-enabled
|
||||
++ [
|
||||
(
|
||||
{ config, options, ... }:
|
||||
{
|
||||
config = lib.mkIf (options.plugins.web-devicons.enable.highestPrio == 1490) {
|
||||
warnings = [
|
||||
''
|
||||
Nixvim: `plugins.web-devicons` was enabled automatically because the following plugins are enabled.
|
||||
This behaviour is deprecated. Please explicitly define `plugins.web-devicons.enable` or alternatively enable `plugins.mini.modules.icons` with `plugins.mini.mockDevIcons`.
|
||||
${lib.concatMapStringsSep "\n" (name: "plugins.${name}") (
|
||||
builtins.filter (name: config.plugins.${name}.enable) iconsPackagePlugins
|
||||
)}
|
||||
''
|
||||
];
|
||||
};
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue