Skip to content

Commit 84796a7

Browse files
committed
flake-modules/tests: introduce callTest(s) auto-arg helpers
Allows using the `callPackage(s)` pattern on tests. Currently only used for the main `../tests` import.
1 parent 3aafb55 commit 84796a7

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

flake-modules/tests.nix

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
{ self, helpers, ... }:
1+
{
2+
self,
3+
lib,
4+
helpers,
5+
...
6+
}:
27
{
38
perSystem =
49
{
@@ -11,6 +16,21 @@
1116
}:
1217
let
1318
inherit (self'.legacyPackages) nixvimConfiguration;
19+
20+
autoArgs = pkgs // {
21+
inherit
22+
helpers
23+
lib
24+
makeNixvimWithModule
25+
nixvimConfiguration
26+
pkgsUnfree
27+
self
28+
system
29+
;
30+
};
31+
32+
callTest = lib.callPackageWith autoArgs;
33+
callTests = lib.callPackagesWith autoArgs;
1434
in
1535
{
1636
checks = {
@@ -52,6 +72,6 @@
5272
package-options = pkgs.callPackage ../tests/package-options.nix { inherit nixvimConfiguration; };
5373

5474
lsp-all-servers = pkgs.callPackage ../tests/lsp-servers.nix { inherit nixvimConfiguration; };
55-
} // import ../tests { inherit pkgs pkgsUnfree helpers; };
75+
} // callTests ../tests { };
5676
};
5777
}

0 commit comments

Comments
 (0)