Commit graph

15 commits

Author SHA1 Message Date
Matt Sturgeon
3172e48dbb
lib/tests: simplify access to default system 2025-01-17 10:16:10 +00:00
Matt Sturgeon
9bf4c9d55b
wrappers/standalone: make pkgs arg optional, allow specifying system 2025-01-17 10:16:10 +00:00
Gaetan Lepage
f1b5c2c593 lib/tests: remove deprecated dontRun 2024-12-23 10:23:39 +00:00
Matt Sturgeon
4b3b67fb6f
lib: make overrideable & access via flake
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.
2024-12-21 15:17:43 +00:00
Matt Sturgeon
bef9feb446
lib/modules: pass inputs.nixpkgs into evalNixvim
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.
2024-12-15 18:41:23 +00:00
Matt Sturgeon
32027965d8
lib: remove dependency on pkgs 2024-12-15 18:24:57 +00: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
692e39311e
modules/{output,files,test}: move outputs to build scope
Move the following output options into `build`:
- finalPackage -> package
- printInitPackage
- initPath -> initFile
- filesPlugin -> extraFiles
- test.derivation -> test
2024-09-26 06:31:57 +01:00
Matt Sturgeon
191b0a9502
treewide: avoid passing pkgs to our lib
In the two places where our "helpers" lib is exclusively internal
(flake module args and building the docs), we no longer supply `pkgs`.

In the other 4 locations, we now note why we still do in a comment.
2024-09-22 18:18:05 +01:00
Matt Sturgeon
7a147234f8
lib: rename helpers.nix -> default.nix
The old `default.nix` is inlined into the "lib" flake-module, which is
the only place it was used.

This allows "helpers" to take its rightful place at the root of `./lib` 👑
2024-09-13 17:25:17 +01:00
Matt Sturgeon
9af4c3970c
tests: fix tests by enabling wrapRc
Since cbd1003d9d I'm able to add _some_
invalid config definitions to modules the tests are using and get no
build error.

For example `extraConfigLua = null;` should produce an invalid type
error, but doesn't.

One less visible change in that commit is the move away from using the
"standalone" wrapper (`makeNixvimWithModule`), which implicitly sets
`wrapRc = true`.

Adding back `wrapRc` to the tests seems to fix the issue, however this
makes me wonder if there's an underlying issue with wrapping/not-wrapping?

Perhaps we've simply uncovered a long-standing eval issue that is masked
over by using `wrapRc`?
2024-08-26 21:57:05 +01:00
Matt Sturgeon
fa2058970c
lib/tests.nix: fix infinite recursion in args 2024-08-26 21:57:05 +01:00
Matt Sturgeon
088e584e54
modules/test: check warnings/assertions
Warnings and assertions defined as `config.warnings` and `config.assertions`
respectively will be checked as part of the test derivation, instead of
when evaluating the modules.

Adds new `checkWarnings` and `checkAssertions` test options (default true).
2024-08-22 14:46:55 +01:00
Matt Sturgeon
19d5f4b134
lib/test: move from tests/test-derivation 2024-08-21 02:48:06 +01:00
Renamed from tests/test-derivation.nix (Browse further)