Instead of maintainers providing an actual `defaultPackage`, they should
specify the pkg name which we'll use when calling `lib.mkPackageOption`.
This makes `mkVimPlugin` and `mkNeovimPlugin` compliant with #1950.
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')";
}
NixOS, HM, & Darwin provide a `lib` option, not to be confused with the
`lib` module arg.
This option is intended for modules to define custom functions without
having to extend nixpkgs lib.
The old option is renamed, if it is accessed it will print:
trace: Obsolete option `nixvim.helpers' is used. It was renamed to `lib.nixvim'.
Rather than nesting it as `config`, pass `makeNixvim`'s argument through
directly as a module.
This not only simplifies the implementation, but allows users to use
`makeNixvim` for any scenario where `makeNixvimWithModule` would normally
be required.
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.