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
This commit is contained in:
Nicolas Pierron 2009-09-15 00:18:00 +00:00
parent a9eadf9fe6
commit 81ec373e1e

View file

@ -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_;