diff --git a/lib/extend-lib.nix b/lib/extend-lib.nix index 772be92c15..960cc0c43b 100644 --- a/lib/extend-lib.nix +++ b/lib/extend-lib.nix @@ -1,5 +1,9 @@ # Extends nixpkg's lib with our functions, as expected by our modules -{ lib, helpers }: +{ + call, + lib, + helpers, +}: lib.extend ( final: prev: { # Include our custom lib @@ -7,5 +11,8 @@ lib.extend ( # Merge in our maintainers maintainers = prev.maintainers // import ./maintainers.nix; + + # Merge in our custom types + types = call ./types.nix { } // prev.types; } ) diff --git a/lib/helpers.nix b/lib/helpers.nix index 030ca87344..84eeac5529 100644 --- a/lib/helpers.nix +++ b/lib/helpers.nix @@ -8,7 +8,7 @@ let # Used when importing parts of helpers call = lib.callPackageWith { # TODO: deprecate/remove using `helpers` in the subsections - inherit pkgs helpers; + inherit call pkgs helpers; lib = helpers.extendedLib; }; @@ -22,7 +22,6 @@ let lua = call ./to-lua.nix { }; modules = call ./modules.nix { }; neovim-plugin = call ./neovim-plugin.nix { }; - nixvimTypes = call ./types.nix { }; options = call ./options.nix { }; utils = call ./utils.nix { inherit _nixvimTests; }; vim-plugin = call ./vim-plugin.nix { }; @@ -92,6 +91,9 @@ let # TODO: Deprecate this `maintainers` alias inherit (helpers.extendedLib) maintainers; + # TODO: Deprecate the old `nixvimTypes` alias? + nixvimTypes = helpers.extendedLib.types; + toLuaObject = helpers.lua.toLua; mkLuaInline = helpers.lua.mkInline; }; diff --git a/lib/types.nix b/lib/types.nix index 489011ee43..772e6387d0 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -1,3 +1,4 @@ +# Custom types to be included in `lib.types` { lib, helpers }: with lib; with helpers; @@ -91,5 +92,3 @@ rec { }"; }; } -# Allow to do `with nixvimTypes;` instead of `with types;` -// lib.types