Skip to content

Commit 6b5c1cf

Browse files
committed
lib/tests: simplify access to default system
1 parent ff1818b commit 6b5c1cf

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

flake-modules/lib.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
{ pkgs, system, ... }:
2828
{
2929
# NOTE: this is the publicly documented flake output we've had for a while
30-
check = pkgs.callPackage ../lib/tests.nix { inherit self; };
30+
check = pkgs.callPackage ../lib/tests.nix {
31+
inherit lib self system;
32+
};
3133

3234
# NOTE: no longer needs to be per-system
3335
helpers = lib.warn "nixvim: `<nixvim>.lib.${system}.helpers` has been moved to `<nixvim>.lib.nixvim` and no longer depends on a specific system" self.lib.nixvim;

lib/tests.nix

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
self,
3-
pkgs,
4-
lib ? pkgs.lib,
5-
...
3+
system,
4+
lib,
65
}:
76
let
8-
defaultPkgs = pkgs;
7+
defaultSystem = system;
98

109
# Create a nix derivation from a nixvim executable.
1110
# The build phase simply consists in running the provided nvim binary.
@@ -31,7 +30,7 @@ let
3130
{
3231
name ? null,
3332
pkgs ? null,
34-
system ? defaultPkgs.stdenv.hostPlatform.system,
33+
system ? defaultSystem,
3534
module,
3635
extraSpecialArgs ? { },
3736
}:

tests/main.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
pkgs,
99
pkgsUnfree,
1010
self,
11+
system,
1112
}:
1213
let
1314
fetchTests = callTest ./fetch-tests.nix { };
14-
test-derivation = callPackage ../lib/tests.nix { inherit self; };
15+
test-derivation = callPackage ../lib/tests.nix {
16+
inherit lib self system;
17+
};
1518
inherit (test-derivation) mkTestDerivationFromNixvimModule;
1619

1720
moduleToTest =

0 commit comments

Comments
 (0)