nix-community.nixvim/lib/default.nix

103 lines
2.3 KiB
Nix
Raw Normal View History

{
pkgs,
lib ? pkgs.lib,
_nixvimTests ? false,
...
}:
# Build helpers recursively
lib.fix (
self:
let
# Used when importing parts of helpers
call = lib.callPackageWith {
inherit call pkgs self;
helpers = self; # TODO: stop using `helpers` in the subsections
lib = self.extendedLib;
};
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 { };
neovim-plugin = call ./neovim-plugin.nix { };
options = call ./options.nix { };
utils = call ./utils.nix { inherit _nixvimTests; };
vim-plugin = call ./vim-plugin.nix { };
# Top-level helper aliases:
# TODO: deprecate some aliases
inherit (self.builders)
writeLua
writeByteCompiledLua
byteCompileLuaFile
byteCompileLuaHook
byteCompileLuaDrv
;
inherit (self.deprecation)
getOptionRecursive
mkDeprecatedSubOptionModule
mkSettingsRenamedOptionModules
transitionType
;
inherit (self.options)
defaultNullOpts
mkCompositeOption
mkCompositeOption'
mkNullOrLua
mkNullOrLua'
mkNullOrLuaFn
mkNullOrLuaFn'
mkNullOrOption
mkNullOrOption'
mkNullOrStr
mkNullOrStr'
mkNullOrStrLuaFnOr
mkNullOrStrLuaFnOr'
mkNullOrStrLuaOr
mkNullOrStrLuaOr'
mkPackageOption
mkPluginPackageOption
mkSettingsOption
pluginDefaultText
;
inherit (self.utils)
concatNonEmptyLines
emptyTable
enableExceptInTests
groupListBySize
hasContent
ifNonNull'
listToUnkeyedAttrs
mkIfNonNull
mkIfNonNull'
mkRaw
mkRawKey
override
overrideDerivation
toRawKeys
toSnakeCase
upperFirstChar
wrapDo
wrapLuaForVimscript
wrapVimscriptForLua
;
# TODO: Deprecate this `maintainers` alias
inherit (self.extendedLib) maintainers;
# TODO: Deprecate the old `nixvimTypes` alias?
nixvimTypes = self.extendedLib.types;
toLuaObject = self.lua.toLua;
mkLuaInline = self.lua.mkInline;
}
)