From 81ec373e1eb62421beab861e2a0f440023a3d88d Mon Sep 17 00:00:00 2001 From: Nicolas Pierron Date: Tue, 15 Sep 2009 00:18:00 +0000 Subject: [PATCH] Imports of imported attribute set are not working anymore because this feature is hard to maintain and because this a potential source of error. Imports are only accepted inside named modules where the system has some control over mutual inclusion. svn path=/nixos/trunk/; revision=17143 --- lib/build-vms.nix | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/build-vms.nix b/lib/build-vms.nix index c35906adfc5..e8b21fb6dfd 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -53,11 +53,14 @@ rec { buildVM = - nodes: configuration: + nodes: configurations: import "${nixos}/lib/eval-config.nix" { inherit nixpkgs services system; - modules = [ configuration ]; + modules = configurations ++ [ + "${nixos}/modules/virtualisation/qemu-vm.nix" # !!! + "${nixos}/modules/testing/test-instrumentation.nix" # !!! should only get added for automated test runs + ]; extraArgs = { inherit nodes; }; /* !!! bug in the module/option handling: this ignores the config from assignIPAddresses. Too much magic. @@ -88,13 +91,8 @@ rec { # Generate a /etc/hosts file. hosts = lib.concatMapStrings (m: "${m.second} ${m.first}\n") machinesWithIP; - nodes_ = map (m: lib.nameValuePair m.first - { imports = [ - (lib.getAttr m.first nodes) - "${nixos}/modules/virtualisation/qemu-vm.nix" # !!! - "${nixos}/modules/testing/test-instrumentation.nix" # !!! should only get added for automated test runs - ]; - config = + nodes_ = map (m: lib.nameValuePair m.first [ + { config = { networking.hostName = m.first; networking.interfaces = [ { name = "eth1"; @@ -105,7 +103,8 @@ rec { services.nixosManual.enable = false; # !!! }; } - ) machinesWithIP; + (lib.getAttr m.first nodes) + ]) machinesWithIP; in lib.listToAttrs nodes_;