aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-25 23:19:58 +0000
committertv <tv@krebsco.de>2026-11-26 22:06:52 +0100
commit8d1de5030863ee5ffe69be533f349ebbcbecbfe5 (patch)
tree57120b1f19a0e5be5977322971ab00ab005091e5 /pkgs
parentecc5461d8a1147d2da70ea6913333e4d769a2bd2 (diff)
tests: give the VMs a store image of their own
The VMs used the host's store through 9p, whose paths their Nix doesn't know, so each scenario collecting garbage deleted every one of them from the VMs' view. In a nested VM, whose store shows the outer host's paths too, that took more than 45 minutes for one scenario. With useNixStoreImage, each VM gets an image of its own closure, which already holds every script the scenarios run (system.extraDependencies), and collecting garbage only looks at that.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/populate/tests/vm.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/populate/tests/vm.nix b/pkgs/populate/tests/vm.nix
index 55362f9..97737c4 100644
--- a/pkgs/populate/tests/vm.nix
+++ b/pkgs/populate/tests/vm.nix
@@ -34,6 +34,12 @@ let
# The plan refers to all scripts the scenarios run. Being part of the
# system, they survive the scenarios collecting garbage.
system.extraDependencies = [ plan "${./fixtures.sh}" ];
+ # A store of their own, with only their closure, rather than the host's
+ # store through 9p, whose paths the VMs' Nix doesn't know: collecting
+ # garbage would delete each of them from the VMs' view, which takes
+ # longer than the scenarios where the host's store is big and 9p is
+ # slow, e.g. nested.
+ virtualisation.useNixStoreImage = true;
nix.settings.substituters = lib.mkForce [];
environment.systemPackages = [
pkgs.git