How do I bring helpers into scope? #1283
-
This feels like a bit of a silly question, but I am clearly missing something here. I am using the home-manager Nixvim module and would like to pass some raw Lua code using a keybinding in Telescope. It seems as though the helpers.mkRaw function can be used to achieve this, so I followed the instructions in the documentation and tried loading helpers in my telescope.nix file like so: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Did you ever figure this out? It seems based on your description that the docs might have slightly changed, but I am also getting a missing 'nixvim' attribute error trying to do the same exact thing. Just need to use some raw lua code for one of my plugins. |
Beta Was this translation helpful? Give feedback.
-
There's two ways to approach this. Using a submodule definitionYou can assign a module-function to {
programs.nixvim =
{
lib,
...
}:
{
enable = true;
someOption = lib.nixvim.mkRaw ''
print('Hi!');
'';
};
} Via the
|
Beta Was this translation helpful? Give feedback.
There's two ways to approach this.
Using a submodule definition
You can assign a module-function to
programs.nixvim
and that module function has access to nixvim's modules args.Via the
lib
optionAlternatively, we make most of our lib extensions available to the "host" modules (in this case, home-manager) via the
lib
config option.Note that the
lib
config option is entirely unrelated to thelib
module arg.