mirror of
https://github.com/nix-community/nixvim.git
synced 2025-08-25 11:45:27 +02:00
lib/helpers: build recursively
This commit is contained in:
parent
a655679ecc
commit
0e98d9cf1e
8 changed files with 68 additions and 96 deletions
|
@ -1,9 +1,4 @@
|
|||
{
|
||||
lib,
|
||||
nixvimOptions,
|
||||
toLuaObject,
|
||||
nixvimUtils,
|
||||
}:
|
||||
{ lib, helpers }:
|
||||
with lib;
|
||||
{
|
||||
# TODO: DEPRECATED: use the `settings` option instead
|
||||
|
@ -81,7 +76,7 @@ with lib;
|
|||
let
|
||||
optionPath = if isString option then [ option ] else option; # option is already a path (i.e. a list)
|
||||
|
||||
optionPathSnakeCase = map nixvimUtils.toSnakeCase optionPath;
|
||||
optionPathSnakeCase = map helpers.toSnakeCase optionPath;
|
||||
in
|
||||
mkRenamedOptionModule (basePluginPath ++ optionPath) (settingsPath ++ optionPathSnakeCase)
|
||||
) optionsRenamedToSettings);
|
||||
|
@ -90,10 +85,10 @@ with lib;
|
|||
{
|
||||
enable = mkEnableOption originalName;
|
||||
|
||||
package = nixvimOptions.mkPluginPackageOption originalName defaultPackage;
|
||||
package = helpers.mkPluginPackageOption originalName defaultPackage;
|
||||
}
|
||||
// optionalAttrs hasSettings {
|
||||
settings = nixvimOptions.mkSettingsOption {
|
||||
settings = helpers.mkSettingsOption {
|
||||
description = settingsDescription;
|
||||
options = settingsOptions;
|
||||
example = settingsExample;
|
||||
|
@ -113,7 +108,7 @@ with lib;
|
|||
}
|
||||
(optionalAttrs callSetup {
|
||||
${extraConfigNamespace} = ''
|
||||
require('${luaName}')${setup}(${optionalString (cfg ? settings) (toLuaObject cfg.settings)})
|
||||
require('${luaName}')${setup}(${optionalString (cfg ? settings) (helpers.toLuaObject cfg.settings)})
|
||||
'';
|
||||
})
|
||||
(optionalAttrs (isColorscheme && (colorscheme != null)) { colorscheme = mkDefault colorscheme; })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue