mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
This adds the `nixvimExtend` attribute to the generated standalone derivation, this attribute takes a module as an argument and returns a new standalone derivation with the initial module & the extended module merged together.
26 lines
846 B
Markdown
26 lines
846 B
Markdown
# Extending a standalone configuration
|
|
|
|
Given a `nvim` derivation obtained from `makeNixvim` or `makeNivxmiWithModule` it is possible to create a new derivation with additional options.
|
|
|
|
This is done through the `nvim.nixvimExtend` function. This function takes a NixOS module that is going to be merged with the currently set options.
|
|
|
|
This attribute is recursive, meaning that it can be applied an arbitrary number of times.
|
|
|
|
## Example
|
|
|
|
```nix
|
|
{makeNixvimWithModule}: let
|
|
first = makeNixvimWithModule {
|
|
module = {
|
|
extraConfigLua = "-- first stage";
|
|
};
|
|
};
|
|
|
|
second = first.nixvimExtend {extraConfigLua = "-- second stage";};
|
|
|
|
third = second.nixvimExtend {extraConfigLua = "-- third stage";};
|
|
in
|
|
third
|
|
```
|
|
|
|
This will generate a `init.lua` that will contain the three comments from each stages.
|