docs: Move standalone usage to modules section

This commit is contained in:
Matt Sturgeon 2024-04-01 12:05:46 +01:00 committed by Gaétan Lepage
parent db6b61f117
commit 87df94dcbd
3 changed files with 15 additions and 5 deletions

View file

@ -1,26 +0,0 @@
# 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.