mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +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;
|
||||
rec {
|
||||
# Get a (sub)option by walking the path,
|
||||
|
|
|
@ -5,21 +5,24 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
# Used when importing parts of helpers
|
||||
call = lib.callPackageWith { inherit pkgs lib helpers; };
|
||||
|
||||
# Build helpers recursively
|
||||
helpers =
|
||||
{
|
||||
autocmd = import ./autocmd-helpers.nix { inherit lib helpers; };
|
||||
keymaps = import ./keymap-helpers.nix { inherit lib helpers; };
|
||||
lua = import ./to-lua.nix { inherit lib; };
|
||||
autocmd = call ./autocmd-helpers.nix { };
|
||||
keymaps = call ./keymap-helpers.nix { };
|
||||
lua = call ./to-lua.nix { };
|
||||
toLuaObject = helpers.lua.toLua;
|
||||
maintainers = import ./maintainers.nix;
|
||||
neovim-plugin = import ./neovim-plugin.nix { inherit lib helpers; };
|
||||
nixvimTypes = import ./types.nix { inherit lib helpers; };
|
||||
vim-plugin = import ./vim-plugin.nix { inherit lib helpers; };
|
||||
neovim-plugin = call ./neovim-plugin.nix { };
|
||||
nixvimTypes = call ./types.nix { };
|
||||
vim-plugin = call ./vim-plugin.nix { };
|
||||
}
|
||||
// import ./builders.nix { inherit lib pkgs; }
|
||||
// import ./deprecation.nix { inherit lib; }
|
||||
// import ./options.nix { inherit lib helpers; }
|
||||
// import ./utils.nix { inherit lib helpers _nixvimTests; };
|
||||
// call ./builders.nix { }
|
||||
// call ./deprecation.nix { }
|
||||
// call ./options.nix { }
|
||||
// call ./utils.nix { inherit _nixvimTests; };
|
||||
in
|
||||
helpers
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, helpers, ... }:
|
||||
{ lib, helpers }:
|
||||
with lib;
|
||||
with helpers;
|
||||
with lib.types;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue