Commit Graph
412 Commits
Author SHA1 Message Date
Austin Horstman d9b86dba91 lib/types: accept integer highlight colors
Neovim's generated keyset types `fg`, `bg`, `sp`, `ctermfg`, `ctermbg`,
and `link` as `integer|string`, and `nvim_set_hl` accepts an integer for
each. Verified against the pinned 0.12.4:

    nvim_set_hl(0, "X", { fg = 16711680, ctermfg = 1 })

Nixvim declared all six through `mkNullOrStr`, so those values failed to
evaluate even though the highlight submodule is freeform and would
otherwise have passed them through.

Widen them to `either int str`. An integer means a different thing per
attribute, so say which in each description: `fg`, `bg`, and `sp` take a
24-bit RGB value, `ctermfg` and `ctermbg` take a palette index, and
`link` takes a highlight group id.

`mkNullOrStr` has no remaining use in this file, so drop the import.
2026-08-27 17:54:47 +00:00
Austin Horstman 57ab753f71 lib/types: accept raw Lua for highlight attrs
`mkNullOrStr` is `maybeRaw str`, so the string attributes of the
highlight submodule already take raw Lua. `5ae4714e` added that for
strings only, which left every boolean and `blend` on a plain type that
rejects it.

Wrap those in `maybeRaw` as well, so computing any highlight attribute
in Lua no longer needs a workaround for the ones that happen to be
booleans.
2026-08-27 17:54:47 +00:00
PierreBorineandAustin Horstman baa5522752 maintainers: add pierreborine 2026-08-25 20:27:04 +00:00
Matt Sturgeon b1173f007c lib/plugins: build callSetup description dynamically
Based on the default, the description should offer different advice and
cautions.
2026-08-24 21:30:29 +00:00
Austin Horstman 0e1cbf6372 lib/plugins: expose callSetup for all defaults
Modules with a false default did not expose the user option.
Users could not force standard setup generation.
Keep null as the built-in fallback.
Omit the option when Lua configuration is unavailable.
2026-08-24 19:32:22 +00:00
FovirandAustin Horstman fdd3386b85 maintainers: update Fovir's GitHub username
Signed-off-by: Fovir <fovir@disroot.org>
2026-07-25 17:35:51 +00:00
Matt SturgeonandAustin Horstman f2029d9a26 lib/keymaps: remove lua submodule option
Co-authored-by: Austin Horstman <khaneliman12@gmail.com>
2026-06-12 18:04:20 +00:00
Matt Sturgeon 82f2ec369e lib/modules: drop removal stubs 2026-06-08 02:03:06 +00:00
Matt Sturgeon 11a586418c lib/builders: drop removal stubs 2026-06-08 02:03:06 +00:00
Matt Sturgeon 6d522f7805 lib/options: drop removal stubs 2026-06-08 02:03:06 +00:00
Matt Sturgeon 6a2a8308fb modules/autocmd: remove autoCmd.description deprecation 2026-06-08 02:02:28 +00:00
Matt Sturgeon 2d88361744 lib/deprecations: drop mkDeprecatedSubOptionModule and deprecate getOptionRecursive 2026-06-08 00:30:23 +00:00
Matt Sturgeon 13e7d8a9b3 lib/modules: add evalNixvim nixdoc 2026-06-07 12:49:05 +00:00
Filippo AiraldiandMatt Sturgeon dd9bd8ef00 maintainers: add fairaldi 2026-05-29 14:20:19 +00:00
Matt Sturgeon 01bd278849 modules: drop helpers alias
Deprecated since 25.11.
2026-05-25 00:15:52 +00:00
Matt Sturgeon fca03f1759 lib: allow instantiating without a flake instance
Separate `overlay.nix` and `overlay.internal.nix`, to encapsulate the
`flake` argument. This allows non-flake users to import `./overlay.nix`
without providing a dummy `flake = null` attr.

The read-only `config.flake` option is only defined by `evalNixvim` when
`lib` is extended using the overlay in Nixvim's flake outputs.
2026-05-24 03:05:36 +00:00
Austin Horstman f6fd130ad3 lib/plugins: add public callSetup override
Expose a user-facing callSetup option for mkNeovimPlugin users while keeping plugin defaults internal. Preserve optional setup semantics, document the override, and cover the new behavior with unit and failure tests.
2026-04-25 01:23:51 +00:00
Austin Horstman 3f710c0440 lib/plugins: add optional setup plumbing 2026-04-25 01:23:51 +00:00
Robert SliwinskiandAustin Horstman 61aff3d45e lib/options: fix typo 2026-04-24 14:03:09 +00:00
saygo-pngandMatt Sturgeon e3e6ba21ab lib/plugins/mkVimPlugin: Support lazyloading
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-12-29 10:08:37 +00:00
Gaetan LepageandAustin Horstman 1d333fc92e treewide: apply linter suggestions 2025-12-28 04:26:49 +00:00
Matt Sturgeon 8486f9144e lib/modules: init testNixvim and testNixvimWith
Introduce thin wrappers around the `<configuration>.config.build.test`
option, intended to replace the legacy `mkTestDerivationFromNvim` and
`mkTestDerivationFromNixvimModule` functions.
2025-12-12 09:38:29 +00:00
Matt Sturgeon 2695bef079 lib/modules: init buildNixvim and buildNixvimWith
Introduce thin wrappers around the `<configuration>.config.build.package`,
option intended to replace the legacy `makeNixvim` and
`makeNixvimWithModule` functions.
2025-12-12 09:38:29 +00:00
fwastringandGaétan Lepage 91288dfdfb maintainers: add fwastring 2025-12-11 09:29:13 +00:00
Matt Sturgeon cc57493853 lib/options: drop old mkDesc deprecation stub 2025-12-05 13:00:50 +00:00
Matt Sturgeon 59ebcf91e4 lib/top-level: drop old deprecations 2025-12-05 13:00:50 +00:00
Matt Sturgeon 085f50eac5 lib: reimplement call; drop .override
Using `callPackageWith` adds `override` and `overrideDerivation`
attributes to the result, which are not relevant to subsections of
Nixvim's lib section.

Implement our own, simplified, `call` using `intersectAttrs` and
`functionArgs`.

If users wish to modify parts of our lib section, they should extend the
top-level fixpoint to ensure everything stays in sync.
2025-12-05 12:19:52 +00:00
saygo-pngandMatt Sturgeon 03a51dbf3d treewide: NixVim/nixvim -> Nixvim
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-12-04 23:22:21 +00:00
Heitor AugustoandMatt Sturgeon 1d345d4b25 lib/options/mkSettingsOption: use nestedLiteralLua 2025-11-24 10:48:20 +00:00
ArneandGaétan Lepage 318f27bf4d maintainers: add Arne-Zillhardt 2025-11-22 09:28:42 +00:00
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 HinzeandGaétan Lepage 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
FovirandMatt Sturgeon 9e56d5cc59 maintainers: add Fovir 2025-10-07 21:59:51 +00:00
saygo-pngandMatt Sturgeon 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
santoshxshresthaandMatt Sturgeon 80cdf28db4 maintainers: add santosh 2025-09-25 13:26:44 +00:00
Matt SturgeonandGaétan Lepage 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 LepageandGaétan Lepage 8529f1c86b treewide: format with new treefmt 2025-07-25 16:18:00 +00:00
Chelsea WilkinsonandAustin Horstman cebc5458ce maintainers: add ChelseaWilkinson 2025-07-19 17:06:46 +00:00
saygo-pngandGaétan Lepage d80d42f066 maintainers: add saygo-png
Signed-off-by: saygo-png <saygo.mail@proton.me>
2025-07-14 11:27:56 +00:00
Aidan WelchandMatt Sturgeon 2fabda24cc maintainers: add AidanWelch 2025-06-18 23:26:08 +00:00