Commit Graph
10 Commits
Author SHA1 Message Date
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
Timothy GallionandMatt Sturgeon d61584cc4c flake/lib.nix: Use the pinned nixpkgs in from the flake for lib
Currently the lib that is propogated to nixvim modules comes from the `nixpkgs-lib` input from the `flake-parts` flake. This works fine locally because the `nixpkgs-lib` follows `nixpkgs` however downstream repos cannot cannot make `nixvim` follow their own version of `flake-parts` without also overriding `nixpkgs-lib`.

* Clearer path for where lib passed to modules is coming from
* Allow downstream repos more flexibility in follows

Pull lib from the pinned `nixpkgs` input.
2026-01-02 13:47:34 +00:00
Matt SturgeonandGaétan Lepage 60817987a7 flake: remove lib.<system>.helpers
Remove the deprecated <flake>.lib.<system>.helpers output, deprecated in
d39a09d05d
2025-12-03 10:34:03 +00:00
Matt Sturgeon 7d17c1b71d flake: remove helpers module arg
Not to be confused with the Nixvim-configuration `helpers` module arg,
remove the flake-parts `helpers` module arg.
2025-11-24 10:47:38 +00:00
Matt Sturgeon 695b0b80f8 lib/overlay: remove overridability
The lib-overlay was previously wrapped using `makeOverridable`, but its
only input is the flake itself, which is not intended to be overridden.

Remove the wrapper and expose the overlay as a plain function.
2025-11-20 20:57:10 +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 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
Gaetan LepageandGaétan Lepage 8529f1c86b treewide: format with new treefmt 2025-07-25 16:18:00 +00:00
Matt Sturgeon a70b16976b lib: export evalNixvim as top-level alias
- `lib.nixvim.evalNixvim`
- `<nixvim>.lib.evalNixvim` (flake output)
2025-01-20 05:23:05 +00:00
Gaetan Lepage 998bae9dac flake-modules -> flake 2025-01-19 12:56:24 +01:00