lib/types: merge into extendedLib

This commit is contained in:
Matt Sturgeon 2024-08-03 16:28:41 +01:00
parent 38b09c1621
commit b414a53649
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 13 additions and 5 deletions

View file

@ -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;
}
)

View file

@ -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;
};

View file

@ -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