mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
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 =
|
||||
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_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user