mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
docs/helpers: document the "extended" lib
This commit is contained in:
parent
e41696e502
commit
e555ba13b1
1 changed files with 7 additions and 4 deletions
|
@ -1,16 +1,17 @@
|
||||||
# Helpers
|
# Helpers
|
||||||
|
|
||||||
If Nixvim is built using the standalone method, you can access our `helpers` as a module arg:
|
If Nixvim is built using the standalone method, you can access our "helpers" as part of the `lib` module arg:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ helpers, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
# Your config
|
# You can use lib.nixvim in your config
|
||||||
|
fooOption = lib.nixvim.mkRaw "print('hello')";
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
If Nixvim is being used as as a home-manager module, a nixos module, or as a dawwin module,
|
If Nixvim is being used as as a home-manager module, a nixos module, or as a dawwin module,
|
||||||
helpers can be accessed via the `config.lib` option:
|
our "helpers" can be accessed via the `config.lib` option:
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
|
@ -22,6 +23,8 @@ in
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:** the `lib` argument passed to modules is entirely unrelated to the `lib` _option_ accessed as `config.lib`!
|
||||||
|
|
||||||
A certain number of helpers are defined that can be useful:
|
A certain number of helpers are defined that can be useful:
|
||||||
|
|
||||||
- `helpers.emptyTable`: An empty lua table `{}` that will be included in the final lua configuration.
|
- `helpers.emptyTable`: An empty lua table `{}` that will be included in the final lua configuration.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue