Skip to content

Commit 62a77e3

Browse files
authored
Revert "Move tests into a separate sub flake (#272)"
This reverts commit bb981ae.
1 parent f659710 commit 62a77e3

File tree

4 files changed

+44
-131
lines changed

4 files changed

+44
-131
lines changed

examples/flake.lock

Lines changed: 0 additions & 78 deletions
This file was deleted.

examples/flake.nix

Lines changed: 0 additions & 35 deletions
This file was deleted.

flake.nix

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
55

66
outputs =
7-
{
8-
self,
9-
nixpkgs,
10-
}:
7+
{ self, nixpkgs }:
118
let
129
systems = [
1310
"aarch64-linux"
@@ -22,6 +19,17 @@
2219
pkgs = nixpkgs.legacyPackages.${system};
2320
}
2421
);
22+
nix-vm-test-lib =
23+
let
24+
rev = "e34870b8dd2c2d203c05b4f931b8c33eaaf43b81";
25+
sha256 = "sha256:1qp1fq96kv9i1nj20m25057pfcs1b1c9bj4502xy7gnw8caqr30d";
26+
in
27+
"${
28+
builtins.fetchTarball {
29+
url = "https://github.com/numtide/nix-vm-test/archive/${rev}.tar.gz";
30+
inherit sha256;
31+
}
32+
}/lib.nix";
2533
in
2634
{
2735
lib = import ./nix/lib.nix { inherit nixpkgs; };
@@ -39,6 +47,11 @@
3947
};
4048
};
4149

50+
# Only useful for quick tests
51+
systemConfigs.default = self.lib.makeSystemConfig {
52+
modules = [ ./examples/example.nix ];
53+
};
54+
4255
formatter = eachSystem ({ pkgs, ... }: pkgs.treefmt);
4356

4457
devShells = eachSystem (
@@ -48,11 +61,29 @@
4861
}
4962
);
5063

51-
checks = eachSystem (
52-
{ system, ... }:
53-
{
54-
system-manager = self.packages.${system}.default;
55-
}
64+
checks = (
65+
nixpkgs.lib.recursiveUpdate
66+
(eachSystem (
67+
{ system, ... }:
68+
{
69+
system-manager = self.packages.${system}.default;
70+
}
71+
))
72+
{
73+
x86_64-linux =
74+
let
75+
system = "x86_64-linux";
76+
in
77+
(import ./test/nix/modules {
78+
inherit system;
79+
inherit (nixpkgs) lib;
80+
nix-vm-test = import nix-vm-test-lib {
81+
inherit nixpkgs;
82+
inherit system;
83+
};
84+
system-manager = self;
85+
});
86+
}
5687
);
5788
};
5889
}

examples/test/nix/modules/default.nix renamed to test/nix/modules/default.nix

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
system-manager,
44
system,
55
nix-vm-test,
6-
inputs,
76
}:
87

98
let
@@ -36,7 +35,6 @@ let
3635
}
3736
)
3837
];
39-
extraSpecialArgs = { inherit inputs; };
4038
}
4139
);
4240
inherit (toplevel.config) hostPkgs;
@@ -150,19 +148,16 @@ let
150148
}
151149
)
152150
];
153-
extraSpecialArgs = { inherit inputs; };
154151
};
155152

156153
in
157154

158155
forEachUbuntuImage "example" {
159156
modules = [
160157
(testModule "old")
161-
../../../example.nix
162-
];
163-
extraPathsToRegister = [
164-
newConfig
158+
../../../examples/example.nix
165159
];
160+
extraPathsToRegister = [ newConfig ];
166161
testScriptFunction =
167162
{ toplevel, hostPkgs, ... }:
168163
#python
@@ -256,7 +251,7 @@ forEachUbuntuImage "example" {
256251
forEachUbuntuImage "prepopulate" {
257252
modules = [
258253
(testModule "old")
259-
../../../example.nix
254+
../../../examples/example.nix
260255
];
261256
extraPathsToRegister = [ newConfig ];
262257
testScriptFunction =
@@ -314,7 +309,7 @@ forEachUbuntuImage "example" {
314309
forEachUbuntuImage "system-path" {
315310
modules = [
316311
(testModule "old")
317-
../../../example.nix
312+
../../../examples/example.nix
318313
];
319314
extraPathsToRegister = [ newConfig ];
320315
testScriptFunction =

0 commit comments

Comments
 (0)