mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-12 18:24:35 +02:00
lib/neovim-plugin: drop config
arg
This commit is contained in:
parent
2a054b039e
commit
18b7597e6c
101 changed files with 127 additions and 201 deletions
|
@ -14,7 +14,6 @@ with lib;
|
|||
};
|
||||
|
||||
mkNeovimPlugin =
|
||||
config:
|
||||
{
|
||||
name,
|
||||
maintainers,
|
||||
|
@ -71,7 +70,32 @@ with lib;
|
|||
++ (optional deprecateExtraOptions (
|
||||
mkRenamedOptionModule (basePluginPath ++ [ "extraOptions" ]) settingsPath
|
||||
))
|
||||
++ (nixvim.mkSettingsRenamedOptionModules basePluginPath settingsPath optionsRenamedToSettings);
|
||||
++ (nixvim.mkSettingsRenamedOptionModules basePluginPath settingsPath optionsRenamedToSettings)
|
||||
++ [
|
||||
(
|
||||
{ config, ... }:
|
||||
{
|
||||
config =
|
||||
let
|
||||
cfg = config.${namespace}.${name};
|
||||
extraConfigNamespace = if isColorscheme then "extraConfigLuaPre" else "extraConfigLua";
|
||||
in
|
||||
mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
extraPlugins = (optional installPackage cfg.package) ++ extraPlugins;
|
||||
inherit extraPackages;
|
||||
}
|
||||
(optionalAttrs callSetup {
|
||||
${extraConfigNamespace} = ''
|
||||
require('${luaName}')${setup}(${optionalString (cfg ? settings) (helpers.toLuaObject cfg.settings)})
|
||||
'';
|
||||
})
|
||||
(optionalAttrs (isColorscheme && (colorscheme != null)) { colorscheme = mkDefault colorscheme; })
|
||||
(extraConfig cfg)
|
||||
]);
|
||||
}
|
||||
)
|
||||
];
|
||||
|
||||
options.${namespace}.${name} =
|
||||
{
|
||||
|
@ -87,24 +111,5 @@ with lib;
|
|||
};
|
||||
}
|
||||
// extraOptions;
|
||||
|
||||
config =
|
||||
let
|
||||
cfg = config.${namespace}.${name};
|
||||
extraConfigNamespace = if isColorscheme then "extraConfigLuaPre" else "extraConfigLua";
|
||||
in
|
||||
mkIf cfg.enable (mkMerge [
|
||||
{
|
||||
extraPlugins = (optional installPackage cfg.package) ++ extraPlugins;
|
||||
inherit extraPackages;
|
||||
}
|
||||
(optionalAttrs callSetup {
|
||||
${extraConfigNamespace} = ''
|
||||
require('${luaName}')${setup}(${optionalString (cfg ? settings) (helpers.toLuaObject cfg.settings)})
|
||||
'';
|
||||
})
|
||||
(optionalAttrs (isColorscheme && (colorscheme != null)) { colorscheme = mkDefault colorscheme; })
|
||||
(extraConfig cfg)
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue