From 8d1de5030863ee5ffe69be533f349ebbcbecbfe5 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Nov 2026 23:19:58 +0000 Subject: 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. --- pkgs/populate/tests/vm.nix | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pkgs/populate/tests') 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 -- cgit v1.3.1