nixvim
nixvim copied to clipboard
[BUG] docs wrongly claim `helpers` is accessible anywhere
Field | Description |
---|---|
Plugin | N/A |
Nixpkgs | unstable |
Home Manager | unstable |
- [x] I have read the FAQ and my bug is not listed there.
Description
The docs state that I should be able to access the helpers
attribute as a module parameter, however nix flake check
states it is missing.
Minimal, Reproducible Example (MRE)
Not very minimal I'm afraid, but this branch demonstrates the issue when running nix flake check .
(I'll try and make a proper MRE if this proves necessary)
Speculation
My first thought was this is flake related, however I would have expected this to have come up already if so. My next guess is is could be related to the way I add my flake inputs to the nixos/home-manager extraArgs
?
Also unable to access any helpers attribute.
It is present on config.nixvim.helpers
. See here.
I suspect this is happening because I import
the NixVim home-manager module from within my module;
If NixVim is using _module.args
to add helpers
to the module args, then I believe that will only affect modules on the same "import level", for lack of a better term.
As an aside, personally I'd rather access helper libs via a lib
flake output. I'm not massively keen on third-party modules cluttering up my module args...
It is present on
config.nixvim.helpers
Thanks, that's a useful workaround.
lib
is also available as a flake output, I used to use it myself: https://github.com/nix-community/nixvim/blob/main/flake-modules/lib.nix
I've updated the title because I believe this is mostly a documentation issue, rather than an implementation bug.
Perhaps, instead of claiming we can use helpers
anywhere, the flake output and config attribute should also be mentioned.
Maybe there is also a good way to explain where _module.args
has any effect?
I think this used to be true, but due to some refactoring of the helpers it is now broken. I need to look into it but I never find the time...
It is definitely true that this works for standalone nixvim, but I kind of agree that we should not do it for NixOS and Home-Manager because it could conflict with a user defined extraArg