Commit graph

11 commits

Author SHA1 Message Date
Matt Sturgeon
754b8df7e3
tests: remove type passthrough
Nix can only build attrsets with a `type = "derivation"` attr.

Having the configuration's option-type as a passthru attr breaks the
ability to build specific test entries, since they are no longer
`type = "derivation"`.
2025-04-01 20:35:58 +01:00
Matt Sturgeon
ff46e752a1
tests: add useful attrs to test passthru 2025-03-24 23:07:27 +00:00
Matt Sturgeon
1f56d947af
tests: drop use of mkTestDerivationFromNixvimModule 2025-03-24 23:07:27 +00:00
Matt Sturgeon
fecc892145
flake: remove pkgsUnfree arg 2025-01-19 12:55:15 +00:00
Matt Sturgeon
3172e48dbb
lib/tests: simplify access to default system 2025-01-17 10:16:10 +00:00
Matt Sturgeon
5b068e7f8f
tests/nixpkgs: move nixpkgs module test to dedicated drv
This should be separate from `test-sources` because we want to re-use a
common instance of nixpkgs throughout those tests.

Also, moved the existing nixpkgs module test from `test-sources`.

This partially reverts commit c4ad4d0b2e.
2025-01-15 18:04:06 +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
c4ad4d0b2e
modules/nixpkgs: add overlays option
Based on the `nixpkgs.overlays` option available in NixOS, allows users
to further customize the `pkgs` instance used when evaluating nixvim.

The standard module tests are now provided a few extra module args to
enable a test where we instantiate a custom nixpkgs instance.
2024-10-19 21:11:42 +01:00
Matt Sturgeon
036e11665f
tests: cleanup tests to better use callTest pattern
e.g. Prefer taking `pkgs.*` attrs directly as function arguments.
2024-10-18 20:52:02 +01:00
Matt Sturgeon
4a508ceee2
tests: use callTest pattern
Allows using the `callPackage(s)` pattern on tests.

Rather than using `pkgs.callPackage`, we implement our own variant using
`lib.callPackageWith`.

Our variant (`callTest`) includes additional nixvim-specific stuff
commonly used by our tests.
2024-10-18 20:52:02 +01:00
Matt Sturgeon
990ef039f7
tests: move test derivations to tests/default.nix
Move the previous `default.nix` to `main.nix` so that `default.nix` can
be used for defining the set of all test derivations.

`main.nix` is imported by `default.nix`, but is only responsible for the
tests built from `tests/test-sources/`.
2024-10-18 20:51:30 +01:00