Add a non-system specific `<flake>.lib.nixvim` output, which is
equivalent to the existing `<flake>.lib.<system>.helpers` output.
This is now also wrapped with `lib.makeOverridable` to allow overriding
the function args used to construct the nixvim-lib.
Consistently access nixvim-lib via the new flake output, overriding
where necessary.
Expose our locked nixpkgs as the `nixpkgs.source` module options.
This only happens when `evalNixvim` is part of a lib that was provided
`flake` as an argument.
Stubbed the `nixpkgs.source` option for now. Eventually, this will be
used to construct `pkgs` internally. For now, it's purely informational.
`nestedLiteral` converts a `literalExpression` into a `toPretty` style
pretty-printer.
`nestedLiteralLua` composes `nestedLiteral` and `literalLua` together.
Replace `mkNeovimPlugin`'s `installPackage` parameter with a new
internal module option: `packageDecorator`.
The option is a function that applies some transformation to
`cfg.package`'s value before it is installed.
Instead of relying on option `apply` functions to coerce the value to
rawLua, this can be done in the type's merge function.
Inspired by `types.coercedTo` in nixpkgs.
End-users have ran into issues before when attempting to re-use a `lib`
from elsewhere in nixvim's configuration.
If a `lib` without the `nixvim` extension is used, this assertion will
inform the user that this isn't supported.
In the future we can also provide better ways for end-users to overlay
their own lib with nixvim's extensions, but this is not yet implemented.
Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>
This minimal implementation allows `nixpkgs.pkgs` to be defined, but
does not implement evaluating an instance from a pkgsPath when _not_
defined.
The `defaultPkgs` specialArg is dropped in favour of `nixpkgs.pkgs`
being defined. If it's not defined, an assertion is thrown.
In the future, a nixpkgs source path can be supplied, defaulting to the
flake's `inputs.nixpkgs`. Along with other `nixpkgs.*` options, this
will allow a `pkgs` instance to be evaluated within the module eval.
Previously the deprecated builders would warn when used on a lib _with_
`pkgs`, but were simply not present on a lib _without_ `pkgs`.
Now, they are always present, but will throw when evaluated on a lib
_without_ `pkgs`.