mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 18:54:30 +02:00
wrappers: add our lib to the host's _module.args
Make our "extended" lib available to host modules as `_module.args.nixvimLib`. We didn't do this before because `helpers` was too generic of a name, but `nixvimLib` should be ok. { nixvimLib, ... }: { programs.nixvim.someOption = nixvimLib.nixvim.mkRaw "print('Hi')"; }
This commit is contained in:
parent
e555ba13b1
commit
511a328aa3
2 changed files with 21 additions and 3 deletions
|
@ -23,6 +23,18 @@ in
|
|||
}
|
||||
```
|
||||
|
||||
Or you can access the extended `lib` used in standalone builds via the `nixvimLib` module arg:
|
||||
|
||||
```nix
|
||||
{ nixvimLib, ... }:
|
||||
{
|
||||
# You can use nixvimLib.nixvim in your config
|
||||
fooOption = nixvimLib.nixvim.mkRaw "print('hello')";
|
||||
}
|
||||
```
|
||||
|
||||
This "extended" lib, includes everything normally in `lib`, along with some additions from nixvim.
|
||||
|
||||
**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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue