diff --git a/modules/nvim-lazy/default.nix b/modules/nvim-lazy/default.nix index e1a6f96..063b762 100644 --- a/modules/nvim-lazy/default.nix +++ b/modules/nvim-lazy/default.nix @@ -45,13 +45,7 @@ let description = ''Short plugin url. (installation is handled by lazy.nvim)''; }; dir = mkOption { - type = - with types; - nullOr (oneOf [ - path - package - vPlugFunctionType - ]); + type = types.nullOr (vPlugFunctionType); default = null; description = ''A vim plugin package or a path pointing to a local plugin.''; }; @@ -96,17 +90,7 @@ let description = ''When false, or if the function returns false, then this plugin will not be loaded. Useful to disable some plugins in vscode, or firenvim for example.''; }; dependencies = mkOption { - type = - with types; - nullOr ( - (oneOf [ - vPlugFunctionType - (listOf (oneOf [ - str - package - ])) - ]) - ); + type = types.nullOr (vPlugFunctionType); default = null; description = ''A list of plugin names or plugin specs that should be loaded when the plugin loads. Dependencies are always lazy-loaded unless specified otherwise. When specifying a name, make sure the plugin spec has been defined somewhere else.''; }; diff --git a/pkgs/lazyUtils.nix b/pkgs/lazyUtils.nix index 53bb823..a07b4fd 100644 --- a/pkgs/lazyUtils.nix +++ b/pkgs/lazyUtils.nix @@ -121,7 +121,7 @@ let if (builtins.isNull val) then val else fn val; # Wrap function arguments in function so they are inserted as is when parsed. stringLiteral = value: if (builtins.isString value) then (_: value) else value; - resolvePlugin = value: if (builtins.isFunction value) then value vPlug else value; + resolvePlugin = pluginFn: pluginFn vPlug; in lib.pipe plugin [ # Resolve dir and dependencies first so getName can resolve names