1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-21 17:59:41 +01:00
Commit graph

382 commits

Author SHA1 Message Date
Matt Sturgeon
c53e0161c3 lib: simplify bootstrapping
Previously, `lib/top-level.nix` used an `_isExtended` flag to indicate
whether the provided `lib` was already extended. This made bootstrapping
unclear and introduced the possibility of circular construction.

All construction now flows through the lib-overlay, removing
`_isExtended`. As a result, `lib/top-level.nix` always receives the
final extended lib.

The `<flake>.lib.nixvim` output is now defined as:

    (lib.extend <nixvim>.lib.overlay).nixvim

The overlay now imports `top-level.nix` directly, making it the
canonical entrypoint for constructing Nixvim's section of the lib.

A clarifying doccomment was added to `lib/top-level.nix`.
2025-11-20 20:57:10 +00:00
Matt Sturgeon
f11c43612f lib/overlay: rename and document overlay arguments
Rename the overlay arguments from the conventional `final: prev:` to the
more explicit `lib: prevLib:`, reflecting that this overlay operates
only on the Nixpkgs lib, rather than a full package set.

Add a doccomment explaining how the overlay is intended to be applied
(via `lib.extend`) and what each argument represents.

Improved inline comments in the overlay.
2025-11-20 20:57:10 +00:00
Matt Sturgeon
f5235d311e lib: rename default.nix to top-level.nix
Rename `lib/default.nix` to `lib/top-level.nix` to make its purpose
explicit and discourage importing it directly. Consumers should obtain
the extended lib via flake outputs or the overlay, rather than bypassing
the required bootstrapping logic.

This clarifies the file's role and avoids suggesting it is the primary
entrypoint to Nixvim's lib subsection.
2025-11-20 20:57:10 +00:00
Matt Sturgeon
8d0ca9abc4 lib: move enableExceptInTests impl to build.test option
Simplify the `enableExceptInTests` attribute, removing the
`_nixvimTests` argument.

We now do a full re-eval of the nixvim configuration before building the
test, giving us a central place to implement `enableExceptInTests` and
its eventual replacement(s).

This extends support for `enableExceptInTests` to all methods of getting
a nixvim test derivation. Previously, it only worked when using `mkTestDerivationFromNixvimModule`.

In `tests/main.nix`, we avoid the re-eval by doing the initial eval with
a "test mode" lib from the start.
2025-11-20 00:22:57 +00:00
Matt Sturgeon
82bc02466c lib/evalNixvim: deprecate specialArgs.helpers
This has been soft-deprecated for several releases. Now that we have
removed our internal usage, we can introduce an eval warning.
2025-11-19 15:22:27 +00:00
Paul Hinze
d5b0cacdfb maintainers: add phinze 2025-11-14 22:10:52 +00:00
Gaetan Lepage
ecb75f49d1 lib/options (mkSettingsOption): allow more types for settingsOption when no sub-options are explicitly declared 2025-10-24 10:28:17 +00:00
Gaetan Lepage
4439dd85cd lib/options (mkSettingsOption): use lua-types.anything for the freeform type of the settings option 2025-10-24 10:28:17 +00:00
Gaetan Lepage
2a21f0c326 lib/maintainers: remove insipx (already in nixpkgs maintainers) 2025-10-22 17:03:05 +00:00
Fovir
9e56d5cc59 maintainers: add Fovir 2025-10-07 21:59:51 +00:00
saygo-png
4cec67651a lib/plugins: infer packPathName
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-09-27 23:49:59 +00:00
Gaetan Lepage
384ea7aeaf maintainers: remove santosh (already in nixpkgs) 2025-09-26 20:30:52 +00:00
santoshxshrestha
80cdf28db4 maintainers: add santosh 2025-09-25 13:26:44 +00:00
Matt Sturgeon
79533f91c1 lib/plugins: use the module system to merge URLs
This asserts that we don't accidentally end up with conflicting
definitions.

Such conflicts must be made explicit, e.g. using `mkForce` or `mkDefault`.
2025-09-10 09:56:41 +00:00
Matt Sturgeon
7b53322d75 maintainers: update JanKremer's github 2025-08-11 14:19:11 +00:00
Matt Sturgeon
286895f9d7 maintainers: update DanielLaing's github 2025-08-11 14:19:11 +00:00
Gaetan Lepage
8529f1c86b treewide: format with new treefmt 2025-07-25 16:18:00 +00:00
Chelsea Wilkinson
cebc5458ce maintainers: add ChelseaWilkinson 2025-07-19 17:06:46 +00:00
saygo-png
d80d42f066 maintainers: add saygo-png
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-07-14 11:27:56 +00:00
Aidan Welch
2fabda24cc maintainers: add AidanWelch 2025-06-18 23:26:08 +00:00
Matt Sturgeon
1b08a4d976 lib/builders: pass text as file
This fixes potential "argument list too long" errors from bash when
writing large files.
2025-06-11 23:45:05 +00:00
Matt Sturgeon
1d8724144c lib/options: add TODO regarding lua-types
`defaultNullOpts` is generally used for representing lua-options.

We should probably a) rename it something like `luaOptions` and switch
out the primitive types to use the new `lua-types`.
2025-06-04 09:07:48 +00:00
Matt Sturgeon
57b61e4267 lib/lua-types: init
An initial set of option types for representing values serialisable into
lua.
2025-06-04 09:07:48 +00:00
Matt Sturgeon
f4a7447d27
lib/util: move docs from lib/index to doc-comments
Moved all function-specific docs from `docs/lib/index.md` into RFC145
doc-comments.

Added `lib.nixvim.lua.toLuaObject` to hold the public docs and serve as
a stable impl of `toLua'` in case we decide to change its defaults.
2025-05-19 00:23:21 +01:00
Matt Sturgeon
5cf8cb5ee6
lib/utils: split into public and internal files
We will include the public file in the docs.
2025-05-19 00:23:20 +01:00
Matt Sturgeon
0c7e2aa96b
docs: user-guide/helpers.mdlib/index.md
Move the user-guide to the new lib reference docs.

Added a MDBook redirect entry.

Updated man docs.
2025-05-19 00:19:57 +01:00
Matt Sturgeon
0ccc452af2
maintainers: enforce sorting 2025-05-17 00:07:06 +01:00
Jalil David Salamé Messina
b505a2aebd
maintainers: add jalil-salame
Adding myself as a maintainer
2025-05-12 08:41:31 +02:00
Gaetan Lepage
b66559d8ef lib/plugins/mk{Neovim,Vim}Plugin: add dependencies parameter 2025-04-28 02:04:13 +02:00
Matt Sturgeon
e6e5369535
lib/utils: fix literalLua multiline rendering
`lib.generators.toPretty` has bespoke handling for rendering nix strings
using either the `" "` or `'' ''` syntax, based on some heuristics.

Using `toPretty` instead of `toJSON` improves how literal-lua examples
render in the docs.
2025-04-24 19:07:34 +01:00
Po Co
f8ed424711 maintainers: add PoCo 2025-04-15 22:40:13 +01:00
Matt Sturgeon
d94956e5da
lib/deprecation: implement aliases for mkRemovedPackageOptionModule
Allows most existing configs to continue building, now with warnings
instead of assertions when the old `plugins.*.*Package` options are
used.

An assertion will still occur if there is a merge conflict, e.g:
`plugins.a.fooPackage = null` and `plugins.b.fooPackage = pkgs.foo`.
2025-04-15 22:15:18 +01:00
Matt Sturgeon
1095b7f891
lib/deprecations: use real option paths in mkRemovedPackageOptionModule 2025-04-12 04:44:53 +01:00
Kasper Seweryn
3c600e2876 maintainers: add wvffle 2025-04-11 16:52:33 +02:00
Gaetan Lepage
7e6038a69a modules/dependencies: add go 2025-04-11 08:51:45 +10:00
Gaetan Lepage
cfd4b61262 modules/dependencies: init + add curl 2025-04-11 08:51:45 +10:00
Gaetan Lepage
95573411bc modules/keymaps: add replace_keycodes keymap sub-option 2025-03-28 11:32:49 +01:00
Gaetan Lepage
fe95b14d52 lib/keymap-helpers (mapConfigOptions): use mkNullOrStr for desc 2025-03-28 11:32:49 +01:00
Gaetan Lepage
1681cc3869 lib/maintainers: remove jolars as he became a nixpkgs maintainer 2025-03-19 00:51:22 +01:00
Matt Sturgeon
b8c5587399
lib/keymaps: make mode type's description more readable
Only list the enum values once, instead of twice.
2025-02-15 15:09:05 +00:00
Matt Sturgeon
bd46d896a8
lib/keymaps: add a link to :h map-modes 2025-02-15 14:19:24 +00:00
Matt Sturgeon
d3a25cb97f
lib/keymaps: add abbreviation support to modes enum
See https://neovim.io/doc/user/usr_24.html#_abbreviations
2025-02-15 13:51:37 +00:00
Matt Sturgeon
a1e168a2a0
lib/keymaps: replace modes attrs with list
Simplify and remove dead code. Replace the `desc` attrs with inline
comments.
2025-02-15 13:35:19 +00:00
Firelight Flagboy
56e8230939
lib/options: Add mkEnabledOption
Like `lib.options.mkEnableOption` but it's enabled by default
2025-02-06 01:56:55 +00:00
Quentin Boyer
a2f01876f7 lib: Harmonize package options which may not exist in nixpkgs 2025-01-31 22:55:38 +00:00
Matt Sturgeon
1a5f1b4393
lib/plugins: introduce mkMetaModule 2025-01-29 17:39:18 +00:00
Gaetan Lepage
abba4af10b lib/utils: fix typo in example of mkAssertions 2025-01-29 15:05:42 +01:00
Matt Sturgeon
53bfadc2c2
lib/modules: work-around a submodule type-merging issue
Includes a regression test.

Revert "lib/modules: remove explicit `specialArgs.lib`"

This reverts commit b5efe91c52.
2025-01-21 12:10:29 +00:00
Gaetan Lepage
a7e516b322 lib/utils: add mkAssertions 2025-01-20 14:17:26 +01:00
Gaetan Lepage
02e16b2a76 lib/utils: add mkWarnings 2025-01-20 12:25:33 +00:00