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:
parent
a9eadf9fe6
commit
81ec373e1e
|
@ -53,11 +53,14 @@ rec {
|
||||||
|
|
||||||
|
|
||||||
buildVM =
|
buildVM =
|
||||||
nodes: configuration:
|
nodes: configurations:
|
||||||
|
|
||||||
import "${nixos}/lib/eval-config.nix" {
|
import "${nixos}/lib/eval-config.nix" {
|
||||||
inherit nixpkgs services system;
|
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; };
|
extraArgs = { inherit nodes; };
|
||||||
/* !!! bug in the module/option handling: this ignores the
|
/* !!! bug in the module/option handling: this ignores the
|
||||||
config from assignIPAddresses. Too much magic.
|
config from assignIPAddresses. Too much magic.
|
||||||
|
@ -88,13 +91,8 @@ rec {
|
||||||
# Generate a /etc/hosts file.
|
# Generate a /etc/hosts file.
|
||||||
hosts = lib.concatMapStrings (m: "${m.second} ${m.first}\n") machinesWithIP;
|
hosts = lib.concatMapStrings (m: "${m.second} ${m.first}\n") machinesWithIP;
|
||||||
|
|
||||||
nodes_ = map (m: lib.nameValuePair m.first
|
nodes_ = map (m: lib.nameValuePair m.first [
|
||||||
{ imports = [
|
{ config =
|
||||||
(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 =
|
|
||||||
{ networking.hostName = m.first;
|
{ networking.hostName = m.first;
|
||||||
networking.interfaces =
|
networking.interfaces =
|
||||||
[ { name = "eth1";
|
[ { name = "eth1";
|
||||||
|
@ -105,7 +103,8 @@ rec {
|
||||||
services.nixosManual.enable = false; # !!!
|
services.nixosManual.enable = false; # !!!
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
) machinesWithIP;
|
(lib.getAttr m.first nodes)
|
||||||
|
]) machinesWithIP;
|
||||||
|
|
||||||
in lib.listToAttrs nodes_;
|
in lib.listToAttrs nodes_;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue