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;
|
maintainers = import ./maintainers.nix;
|
||||||
keymaps = import ./keymap-helpers.nix {inherit lib nixvimOptions nixvimTypes;};
|
keymaps = import ./keymap-helpers.nix {inherit lib nixvimOptions nixvimTypes;};
|
||||||
autocmd = import ./autocmd-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;};
|
vim-plugin = import ./vim-plugin.nix {inherit lib nixvimOptions;};
|
||||||
inherit nixvimTypes;
|
inherit nixvimTypes;
|
||||||
inherit toLuaObject;
|
inherit toLuaObject;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
lib,
|
lib,
|
||||||
nixvimOptions,
|
nixvimOptions,
|
||||||
toLuaObject,
|
toLuaObject,
|
||||||
|
nixvimUtils,
|
||||||
}:
|
}:
|
||||||
with lib; rec {
|
with lib; rec {
|
||||||
mkSettingsOption = {
|
mkSettingsOption = {
|
||||||
|
@ -34,6 +35,9 @@ with lib; rec {
|
||||||
namespace ? "plugins",
|
namespace ? "plugins",
|
||||||
maintainers,
|
maintainers,
|
||||||
imports ? [],
|
imports ? [],
|
||||||
|
# deprecations
|
||||||
|
deprecateExtraConfig ? false,
|
||||||
|
optionsRenamedToSettings ? [],
|
||||||
# options
|
# options
|
||||||
originalName ? name,
|
originalName ? name,
|
||||||
defaultPackage,
|
defaultPackage,
|
||||||
|
@ -49,7 +53,29 @@ with lib; rec {
|
||||||
}: {
|
}: {
|
||||||
meta.maintainers = maintainers;
|
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} =
|
options.${namespace}.${name} =
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue