mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 17:58:38 +02:00
helpers/vim-plugin/mkVimPlugin: rename extraConfig to settings (RFC 42)
This commit is contained in:
parent
2d7c834866
commit
54da635d45
1 changed files with 13 additions and 5 deletions
|
@ -11,6 +11,7 @@ with lib; {
|
|||
extraPackages ? [],
|
||||
options ? {},
|
||||
globalPrefix ? "",
|
||||
addExtraConfigRenameWarning ? false,
|
||||
...
|
||||
}: let
|
||||
cfg = config.plugins.${name};
|
||||
|
@ -44,10 +45,12 @@ with lib; {
|
|||
package = nixvimOptions.mkPackageOption name package;
|
||||
};
|
||||
|
||||
createSettingsOption = (isString globalPrefix) && (globalPrefix != "");
|
||||
|
||||
extraConfigOption =
|
||||
if (isString globalPrefix) && (globalPrefix != "")
|
||||
then {
|
||||
extraConfig = mkOption {
|
||||
optionalAttrs createSettingsOption
|
||||
{
|
||||
settings = mkOption {
|
||||
type = with types; attrsOf anything;
|
||||
description = ''
|
||||
The configuration options for ${name} without the '${globalPrefix}' prefix.
|
||||
|
@ -60,8 +63,7 @@ with lib; {
|
|||
'';
|
||||
default = {};
|
||||
};
|
||||
}
|
||||
else {};
|
||||
};
|
||||
in {
|
||||
options.plugins.${name} =
|
||||
{
|
||||
|
@ -75,6 +77,12 @@ with lib; {
|
|||
// packageOption
|
||||
// pluginOptions;
|
||||
|
||||
imports = optional (addExtraConfigRenameWarning && createSettingsOption) (
|
||||
mkRenamedOptionModule
|
||||
["plugins" name "extraConfig"]
|
||||
["plugins" name "settings"]
|
||||
);
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
inherit extraPackages globals;
|
||||
# does this evaluate package? it would not be desired to evaluate pacakge if we use another package.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue