diff --git a/nixos/tests/containers-imperative.nix b/nixos/tests/containers-imperative.nix index 8d100fedf78c..81c98a56e077 100644 --- a/nixos/tests/containers-imperative.nix +++ b/nixos/tests/containers-imperative.nix @@ -7,11 +7,20 @@ import ./make-test.nix ({ pkgs, ...} : { }; machine = - { config, pkgs, ... }: + { config, pkgs, system, lib, ... }: { imports = [ ../modules/installer/cd-dvd/channel.nix ]; virtualisation.writableStore = true; virtualisation.memorySize = 768; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + # Make sure we always have all the required dependencies for creating a + # container available within the VM, because we don't have network access. + virtualisation.pathsInNixDB = let + emptyContainer = import ../lib/eval-config.nix { + inherit (config.nixpkgs) system; + modules = lib.singleton { + containers.foo.config = {}; + }; + }; + in [ pkgs.stdenv emptyContainer.config.containers.foo.path ]; }; testScript =