summary refs log tree commit diff
path: root/nixos/tests/containers-imperative.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-05-04 19:53:43 +0200
committeraszlig <aszlig@redmoonstudios.org>2016-05-04 20:18:27 +0200
commit9fa30d3bad80faa60e961147ca9b68a8abb46134 (patch)
tree0c81d06febb42de84392f10e206544ac988974e6 /nixos/tests/containers-imperative.nix
parent6acf41f9bf8cebdc9fc63f48adf08273eba6607f (diff)
downloadnixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.tar
nixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.tar.gz
nixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.tar.bz2
nixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.tar.lz
nixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.tar.xz
nixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.tar.zst
nixpkgs-9fa30d3bad80faa60e961147ca9b68a8abb46134.zip
nixos/tests/containers-imperative: Fix test
Make sure that we always have everything available within the store of
the VM, so let's evaluate/build the test container fully on the host
system and propagate all dependencies to the VM.

This way, even if there are additional default dependencies that come
with containers in the future we should be on the safe side as these
dependencies should now be included for the test as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @kampfschlaefer, @edolstra
Diffstat (limited to 'nixos/tests/containers-imperative.nix')
-rw-r--r--nixos/tests/containers-imperative.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/nixos/tests/containers-imperative.nix b/nixos/tests/containers-imperative.nix
index 8d100fedf78..81c98a56e07 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 =