tests: minify test machines to decrease runtime

This commit is contained in:
DavHau
2024-11-13 20:39:44 +07:00
parent 3b4046b207
commit c2a60dcbb6
5 changed files with 15 additions and 3 deletions

View File

@@ -15,6 +15,7 @@
self.clanModules.single-disk self.clanModules.single-disk
(modulesPath + "/testing/test-instrumentation.nix") # we need these 2 modules always to be able to run the tests (modulesPath + "/testing/test-instrumentation.nix") # we need these 2 modules always to be able to run the tests
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")
../lib/minify.nix
]; ];
clan.single-disk.device = "/dev/vdb"; clan.single-disk.device = "/dev/vdb";

View File

@@ -10,7 +10,9 @@ in
hostPkgs = pkgs; hostPkgs = pkgs;
# speed-up evaluation # speed-up evaluation
defaults = { defaults = {
nix.package = pkgs.nixVersions.latest; imports = [
./minify.nix
];
documentation.enable = lib.mkDefault false; documentation.enable = lib.mkDefault false;
boot.isContainer = true; boot.isContainer = true;

7
checks/lib/minify.nix Normal file
View File

@@ -0,0 +1,7 @@
{
nixpkgs.flake.setFlakeRegistry = false;
nixpkgs.flake.setNixPath = false;
nix.registry.nixpkgs.to = { };
documentation.doc.enable = false;
documentation.man.enable = false;
}

View File

@@ -8,9 +8,11 @@ in
hostPkgs = pkgs; hostPkgs = pkgs;
# speed-up evaluation # speed-up evaluation
defaults = { defaults = {
imports = [
./minify.nix
];
documentation.enable = lib.mkDefault false; documentation.enable = lib.mkDefault false;
nix.settings.min-free = 0; nix.settings.min-free = 0;
nix.package = pkgs.nixVersions.latest;
}; };
# to accept external dependencies such as disko # to accept external dependencies such as disko

View File

@@ -68,7 +68,7 @@ let
nixpkgs.hostPlatform = lib.mkIf (system != null) (lib.mkDefault system); nixpkgs.hostPlatform = lib.mkIf (system != null) (lib.mkDefault system);
# speeds up nix commands by using the nixpkgs from the host system (especially useful in VMs) # speeds up nix commands by using the nixpkgs from the host system (especially useful in VMs)
nix.registry.nixpkgs.to = { nix.registry.nixpkgs.to = lib.mkDefault {
type = "path"; type = "path";
path = lib.mkDefault nixpkgs; path = lib.mkDefault nixpkgs;
}; };