mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 09:18:38 +02:00
lib/helpers: call
with auto-args
Define `call = callPackageWith { inherit pkgs lib helpers; }`, which can be used to automatically pass the correct args into helpers files. `helpers` is passed in recursively.
This commit is contained in:
parent
0e98d9cf1e
commit
040bab5f55
3 changed files with 15 additions and 12 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }:
|
{ lib }:
|
||||||
with lib;
|
with lib;
|
||||||
rec {
|
rec {
|
||||||
# Get a (sub)option by walking the path,
|
# Get a (sub)option by walking the path,
|
||||||
|
|
|
@ -5,21 +5,24 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
# Used when importing parts of helpers
|
||||||
|
call = lib.callPackageWith { inherit pkgs lib helpers; };
|
||||||
|
|
||||||
# Build helpers recursively
|
# Build helpers recursively
|
||||||
helpers =
|
helpers =
|
||||||
{
|
{
|
||||||
autocmd = import ./autocmd-helpers.nix { inherit lib helpers; };
|
autocmd = call ./autocmd-helpers.nix { };
|
||||||
keymaps = import ./keymap-helpers.nix { inherit lib helpers; };
|
keymaps = call ./keymap-helpers.nix { };
|
||||||
lua = import ./to-lua.nix { inherit lib; };
|
lua = call ./to-lua.nix { };
|
||||||
toLuaObject = helpers.lua.toLua;
|
toLuaObject = helpers.lua.toLua;
|
||||||
maintainers = import ./maintainers.nix;
|
maintainers = import ./maintainers.nix;
|
||||||
neovim-plugin = import ./neovim-plugin.nix { inherit lib helpers; };
|
neovim-plugin = call ./neovim-plugin.nix { };
|
||||||
nixvimTypes = import ./types.nix { inherit lib helpers; };
|
nixvimTypes = call ./types.nix { };
|
||||||
vim-plugin = import ./vim-plugin.nix { inherit lib helpers; };
|
vim-plugin = call ./vim-plugin.nix { };
|
||||||
}
|
}
|
||||||
// import ./builders.nix { inherit lib pkgs; }
|
// call ./builders.nix { }
|
||||||
// import ./deprecation.nix { inherit lib; }
|
// call ./deprecation.nix { }
|
||||||
// import ./options.nix { inherit lib helpers; }
|
// call ./options.nix { }
|
||||||
// import ./utils.nix { inherit lib helpers _nixvimTests; };
|
// call ./utils.nix { inherit _nixvimTests; };
|
||||||
in
|
in
|
||||||
helpers
|
helpers
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, helpers, ... }:
|
{ lib, helpers }:
|
||||||
with lib;
|
with lib;
|
||||||
with helpers;
|
with helpers;
|
||||||
with lib.types;
|
with lib.types;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue