mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
Expose our locked nixpkgs as the `nixpkgs.source` module options. This only happens when `evalNixvim` is part of a lib that was provided `flake` as an argument. Stubbed the `nixpkgs.source` option for now. Eventually, this will be used to construct `pkgs` internally. For now, it's purely informational.
108 lines
2.4 KiB
Nix
108 lines
2.4 KiB
Nix
{
|
|
lib,
|
|
flake ? null, # Optionally, provide the lib with access to the flake
|
|
_nixvimTests ? false,
|
|
}:
|
|
lib.fix (
|
|
self:
|
|
let
|
|
# Used when importing parts of our lib
|
|
call = lib.callPackageWith {
|
|
inherit call self;
|
|
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 { inherit flake; };
|
|
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'
|
|
mkLazyLoadOption
|
|
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
|
|
literalLua
|
|
mkIfNonNull
|
|
mkIfNonNull'
|
|
mkRaw
|
|
mkRawKey
|
|
nestedLiteral
|
|
nestedLiteralLua
|
|
override
|
|
overrideDerivation
|
|
toRawKeys
|
|
toSnakeCase
|
|
upperFirstChar
|
|
wrapDo
|
|
wrapLuaForVimscript
|
|
wrapVimscriptForLua
|
|
;
|
|
|
|
toLuaObject = self.lua.toLua;
|
|
mkLuaInline = self.lua.mkInline;
|
|
}
|
|
//
|
|
# TODO: Removed 2024-09-27; remove after 24.11
|
|
lib.mapAttrs
|
|
(
|
|
old: new:
|
|
throw "The `${old}` alias has been removed. Use `${new}` on a lib with nixvim's extensions."
|
|
)
|
|
{
|
|
maintainers = "lib.maintainers";
|
|
nixvimTypes = "lib.types";
|
|
}
|
|
)
|