Skip to content

Commit 459c5d1

Browse files
committed
lib/tests: simplify access to default system
1 parent 4aea281 commit 459c5d1

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

flake-modules/lib.nix

+3-1
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

+4-5
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

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
}:
1313
let
1414
fetchTests = callTest ./fetch-tests.nix { };
15-
test-derivation = callPackage ../lib/tests.nix { inherit self; };
15+
test-derivation = callPackage ../lib/tests.nix {
16+
inherit lib self system;
17+
};
1618
inherit (test-derivation) mkTestDerivationFromNixvimModule;
1719

1820
moduleToTest =

0 commit comments

Comments
 (0)