mirror of
https://github.com/nix-community/nixvim.git
synced 2026-08-24 02:34:15 -05:00
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.
43 lines
1021 B
Nix
43 lines
1021 B
Nix
/**
|
|
Internal function returning Nixvim's Nixpkgs `lib` overlay.
|
|
|
|
Publicly accessible at `./overlay.nix` and the `nixvim.lib.overlay` flake output.
|
|
*/
|
|
{ flake }:
|
|
|
|
/**
|
|
Overlay function extending the Nixpkgs `lib` with Nixvim's additions.
|
|
|
|
This function is intended to be passed to `lib.extend`.
|
|
|
|
# Examples
|
|
|
|
Importing the file directly:
|
|
```
|
|
lib.extend (import (nixvim + "/lib/overlay.nix"))
|
|
```
|
|
|
|
Using the overlay from flake outputs:
|
|
```
|
|
lib.extend nixvim.lib.overlay
|
|
```
|
|
|
|
# Inputs
|
|
|
|
`lib`
|
|
: The final lib instance; the fixpoint of all extensions, including this one.
|
|
|
|
`prevLib`
|
|
: The lib instance prior to applying this overlay.
|
|
*/
|
|
lib: prevLib: {
|
|
# Add Nixvim's section to the lib
|
|
nixvim = import ./top-level.nix { inherit flake lib; };
|
|
|
|
# Extend the maintainers set with Nixvim-specific maintainers
|
|
maintainers = prevLib.maintainers // import ./maintainers.nix;
|
|
|
|
# Extend lib.types with Nixvim's custom types
|
|
types = prevLib.types // import ./types.nix { inherit lib; };
|
|
}
|