mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 10:44:34 +02:00
lib/overlay: init
The overlay allows extending any instance of nixpkgs-lib into a nixvim-compatible "extended" instance.
This commit is contained in:
parent
450cccf472
commit
aefab28b3b
6 changed files with 27 additions and 25 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
lib,
|
||||
flake ? null, # Optionally, provide the lib with access to the flake
|
||||
flake,
|
||||
_isExtended ? false,
|
||||
_nixvimTests ? false,
|
||||
}:
|
||||
lib.makeExtensible (
|
||||
|
@ -9,14 +10,15 @@ lib.makeExtensible (
|
|||
# Used when importing parts of our lib
|
||||
call = lib.callPackageWith {
|
||||
inherit call self;
|
||||
lib = self.extendedLib;
|
||||
# TODO: this would be much simpler if `lib` & `self` were kept explicitly separate
|
||||
# Doing so should also improve overridability and simplify bootstrapping.
|
||||
lib = if _isExtended then lib else lib.extend flake.lib.overlay;
|
||||
};
|
||||
in
|
||||
{
|
||||
autocmd = call ./autocmd-helpers.nix { };
|
||||
builders = call ./builders.nix { };
|
||||
deprecation = call ./deprecation.nix { };
|
||||
extendedLib = call ./extend-lib.nix { inherit lib; };
|
||||
keymaps = call ./keymap-helpers.nix { };
|
||||
lua = call ./to-lua.nix { };
|
||||
modules = call ./modules.nix { inherit flake; };
|
||||
|
@ -93,6 +95,9 @@ lib.makeExtensible (
|
|||
|
||||
toLuaObject = self.lua.toLua;
|
||||
mkLuaInline = self.lua.mkInline;
|
||||
|
||||
# TODO: Removed 2024-12-21
|
||||
extendedLib = throw "`extendedLib` has been removed. Use `lib.extend <nixvim>.lib.overlay` instead.";
|
||||
}
|
||||
//
|
||||
# TODO: Removed 2024-09-27; remove after 24.11
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue