mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
lib/plugins: call sub-components with relevant args
This commit is contained in:
parent
690fc895b5
commit
787844cfe4
4 changed files with 21 additions and 23 deletions
|
@ -1,13 +1,14 @@
|
|||
{
|
||||
call,
|
||||
lib,
|
||||
}:
|
||||
{ lib }:
|
||||
let
|
||||
self = lib.nixvim.plugins;
|
||||
call = lib.callPackageWith (self // { inherit call lib self; });
|
||||
in
|
||||
{
|
||||
utils = call ./utils.nix { };
|
||||
neovim = call ./neovim.nix { };
|
||||
vim = call ./vim.nix { };
|
||||
|
||||
# Aliases
|
||||
inherit (lib.nixvim.plugins.neovim) mkNeovimPlugin;
|
||||
inherit (lib.nixvim.plugins.vim) mkVimPlugin;
|
||||
inherit (self.neovim) mkNeovimPlugin;
|
||||
inherit (self.vim) mkVimPlugin;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
{ lib }:
|
||||
{
|
||||
lib,
|
||||
utils,
|
||||
}:
|
||||
{
|
||||
name,
|
||||
maintainers,
|
||||
|
@ -56,7 +59,7 @@ let
|
|||
})
|
||||
'';
|
||||
|
||||
luaConfigAtLocation = lib.nixvim.plugins.utils.mkConfigAt configLocation cfg.luaConfig.content;
|
||||
luaConfigAtLocation = utils.mkConfigAt configLocation cfg.luaConfig.content;
|
||||
in
|
||||
{
|
||||
meta = {
|
||||
|
@ -105,7 +108,7 @@ let
|
|||
|
||||
# Apply any additional configuration added to `extraConfig`
|
||||
(lib.optionalAttrs (args ? extraConfig) (
|
||||
lib.nixvim.plugins.utils.applyExtraConfig {
|
||||
utils.applyExtraConfig {
|
||||
inherit extraConfig cfg opts;
|
||||
}
|
||||
))
|
||||
|
@ -162,7 +165,7 @@ in
|
|||
imports
|
||||
++ [
|
||||
module
|
||||
(lib.nixvim.plugins.utils.mkPluginPackageModule { inherit loc packPathName package; })
|
||||
(utils.mkPluginPackageModule { inherit loc packPathName package; })
|
||||
]
|
||||
++ lib.optional deprecateExtraOptions (
|
||||
lib.mkRenamedOptionModule (loc ++ [ "extraOptions" ]) settingsPath
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
{ lib }:
|
||||
let
|
||||
inherit (lib.nixvim.plugins.vim)
|
||||
mkSettingsOption
|
||||
;
|
||||
in
|
||||
{
|
||||
lib,
|
||||
self,
|
||||
}:
|
||||
{
|
||||
name,
|
||||
url ? throw "default",
|
||||
|
@ -43,7 +41,7 @@ let
|
|||
createSettingsOption = lib.isString globalPrefix && globalPrefix != "";
|
||||
|
||||
settingsOption = lib.optionalAttrs createSettingsOption {
|
||||
settings = mkSettingsOption {
|
||||
settings = self.vim.mkSettingsOption {
|
||||
options = settingsOptions;
|
||||
example = settingsExample;
|
||||
inherit name globalPrefix;
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
{
|
||||
call,
|
||||
lib,
|
||||
self,
|
||||
}:
|
||||
let
|
||||
inherit (lib.nixvim.plugins.vim)
|
||||
mkSettingsOptionDescription
|
||||
;
|
||||
in
|
||||
{
|
||||
mkVimPlugin = call ./mk-vim-plugin.nix { };
|
||||
|
||||
|
@ -31,6 +27,6 @@ in
|
|||
}:
|
||||
lib.nixvim.mkSettingsOption {
|
||||
inherit options example;
|
||||
description = mkSettingsOptionDescription { inherit name globalPrefix; };
|
||||
description = self.vim.mkSettingsOptionDescription { inherit name globalPrefix; };
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue