mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
standalone: Allow to extend a standalone derivation with a new module (#1142)
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.
This commit is contained in:
parent
66c019d638
commit
9cd3721adf
6 changed files with 91 additions and 24 deletions
26
docs/user-guide/extending-config.md
Normal file
26
docs/user-guide/extending-config.md
Normal file
|
@ -0,0 +1,26 @@
|
|||
# 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.
|
Loading…
Add table
Add a link
Reference in a new issue