mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
helpers/neovim-plugin/mkNeovimPlugin: add deprecateExtraConfig and optionsRenamedToSettings options
This commit is contained in:
parent
7f57d0b1b8
commit
efdd9f2688
2 changed files with 28 additions and 2 deletions
|
@ -13,7 +13,7 @@ in
|
|||
maintainers = import ./maintainers.nix;
|
||||
keymaps = import ./keymap-helpers.nix {inherit lib nixvimOptions nixvimTypes;};
|
||||
autocmd = import ./autocmd-helpers.nix {inherit lib nixvimOptions nixvimTypes;};
|
||||
neovim-plugin = import ./neovim-plugin.nix {inherit lib nixvimOptions toLuaObject;};
|
||||
neovim-plugin = import ./neovim-plugin.nix {inherit lib nixvimOptions nixvimUtils toLuaObject;};
|
||||
vim-plugin = import ./vim-plugin.nix {inherit lib nixvimOptions;};
|
||||
inherit nixvimTypes;
|
||||
inherit toLuaObject;
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
lib,
|
||||
nixvimOptions,
|
||||
toLuaObject,
|
||||
nixvimUtils,
|
||||
}:
|
||||
with lib; rec {
|
||||
mkSettingsOption = {
|
||||
|
@ -34,6 +35,9 @@ with lib; rec {
|
|||
namespace ? "plugins",
|
||||
maintainers,
|
||||
imports ? [],
|
||||
# deprecations
|
||||
deprecateExtraConfig ? false,
|
||||
optionsRenamedToSettings ? [],
|
||||
# options
|
||||
originalName ? name,
|
||||
defaultPackage,
|
||||
|
@ -49,7 +53,29 @@ with lib; rec {
|
|||
}: {
|
||||
meta.maintainers = maintainers;
|
||||
|
||||
inherit imports;
|
||||
imports = let
|
||||
basePluginPath = [namespace name];
|
||||
in
|
||||
imports
|
||||
++ (
|
||||
optional
|
||||
deprecateExtraConfig
|
||||
(
|
||||
mkRenamedOptionModule
|
||||
(basePluginPath ++ ["extraConfig"])
|
||||
(basePluginPath ++ ["settings"])
|
||||
)
|
||||
)
|
||||
++ (
|
||||
map
|
||||
(
|
||||
optionName:
|
||||
mkRenamedOptionModule
|
||||
(basePluginPath ++ [optionName])
|
||||
(basePluginPath ++ ["settings" (nixvimUtils.toSnakeCase optionName)])
|
||||
)
|
||||
optionsRenamedToSettings
|
||||
);
|
||||
|
||||
options.${namespace}.${name} =
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue