mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 09:18:38 +02:00
misc: refactor imports, prefer adding helpers
to args rather than importing it
This commit is contained in:
parent
541b694873
commit
b6724702b4
160 changed files with 697 additions and 736 deletions
|
@ -1,8 +1,9 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
} @ attrs: let
|
||||
}: let
|
||||
helpers = import ../../helpers.nix {inherit lib;};
|
||||
in
|
||||
with helpers;
|
||||
|
@ -13,7 +14,7 @@ in
|
|||
useDefaultPackage ? true,
|
||||
...
|
||||
}:
|
||||
mkPlugin attrs {
|
||||
mkPlugin {inherit lib config pkgs;} {
|
||||
inherit name;
|
||||
extraPlugins = extraPlugins ++ (lists.optional useDefaultPackage pkgs.vimPlugins.${name});
|
||||
description = "Enable ${name}";
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
} @ args:
|
||||
with lib; let
|
||||
cfg = config.plugins.nvim-cmp;
|
||||
helpers = import ../../helpers.nix {inherit lib;};
|
||||
cmpLib = import ./cmp-helpers.nix args;
|
||||
|
||||
snippetEngines = {
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.cmp-tabnine;
|
||||
helpers = import ../../../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options.plugins.cmp-tabnine = helpers.extraOptionsOptions;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
copilot-lua-cfg = config.plugins.copilot-lua;
|
||||
cfg = config.plugins.copilot-cmp;
|
||||
helpers = import ../../../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options.plugins.copilot-cmp =
|
||||
helpers.extraOptionsOptions
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.plugins.crates-nvim;
|
||||
helpers = import ../../../helpers.nix {inherit lib;};
|
||||
in {
|
||||
options.plugins.crates-nvim = helpers.extraOptionsOptions;
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
} @ attrs:
|
||||
}:
|
||||
with lib; let
|
||||
cmpLib = import ../cmp-helpers.nix attrs;
|
||||
cmpSourcesPluginNames = lib.attrValues cmpLib.pluginAndSourceNames;
|
||||
cmpLib = import ../cmp-helpers.nix {inherit lib config pkgs;};
|
||||
cmpSourcesPluginNames = attrValues cmpLib.pluginAndSourceNames;
|
||||
pluginModules = lists.map (name: cmpLib.mkCmpSourcePlugin {inherit name;}) cmpSourcesPluginNames;
|
||||
in {
|
||||
# For extra cmp plugins
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue