Commit graph

9 commits

Author SHA1 Message Date
Matt Sturgeon
63cfc84abe
lib/modules: add applyExtraConfig
Used for
- mkVimPlugin: extraConfig
- mkNeovimPlugin: extraConfig
- mkLsp: extraConfig
- mkLsp: settings
- mkExtension (telecsope): extraConfig
2024-11-20 20:55:16 +00:00
Matt Sturgeon
6b0c5d594a
lib/modules: assert that specialArgs has a valid lib
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>
2024-09-27 11:11:49 +01:00
Matt Sturgeon
5020e58798
lib/modules: remove specialArgsWith 2024-09-27 09:30:12 +01:00
Matt Sturgeon
4b7a41276a
modules/nixpkgs: initial pkgs option, drop defaultPkgs specialArg
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.
2024-09-27 09:30:12 +01:00
Matt Sturgeon
6a1bf6bdc3
modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00
Matt Sturgeon
4e5bd1d79b
lib: segregate and deprecate functions that need pkgs
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.

This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
  and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
  to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
  evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
  final lib.
2024-09-13 19:05:26 +01:00
Matt Sturgeon
cbd1003d9d
modules/test: move test derivation to an option
Introduced the `test.derivation` read-only option.
2024-08-21 02:48:00 +01:00
Matt Sturgeon
851edc8df1
lib/modules: add evalNixvim
Evaluates a nixvim config, by default also checking warnings and assertions.

This used internally by the standalone wrapper.
2024-08-20 22:22:53 +01:00
Matt Sturgeon
27c4c9c210
lib/modules: init with specialArgs helpers 2024-08-02 14:38:38 +01:00