summary refs log tree commit diff
path: root/nixos/lib/build-vms.nix
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-07-16 17:29:50 -0500
committerWilliam A. Kennington III <william@wkennington.com>2014-08-30 07:33:38 -0700
commit86c0f8c549c2ad728e06f8bc11d805fe760e7df8 (patch)
tree9c71752eb9b2a01e4173b598df7f68e9c8d7b496 /nixos/lib/build-vms.nix
parent1ff4b838758f36dc8c54995e104dd17ba08a65a4 (diff)
downloadnixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.tar
nixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.tar.gz
nixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.tar.bz2
nixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.tar.lz
nixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.tar.xz
nixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.tar.zst
nixpkgs-86c0f8c549c2ad728e06f8bc11d805fe760e7df8.zip
Refactor nixos files relying on the old ipAddress / prefixLength / subnetMask attributes
Diffstat (limited to 'nixos/lib/build-vms.nix')
-rw-r--r--nixos/lib/build-vms.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix
index 498c0a37783..ba189555409 100644
--- a/nixos/lib/build-vms.nix
+++ b/nixos/lib/build-vms.nix
@@ -48,10 +48,11 @@ rec {
             let
               interfacesNumbered = zipTwoLists config.virtualisation.vlans (range 1 255);
               interfaces = flip map interfacesNumbered ({ first, second }:
-                nameValuePair "eth${toString second}"
-                  { ipAddress = "192.168.${toString first}.${toString m.second}";
-                    subnetMask = "255.255.255.0";
-                  });
+                nameValuePair "eth${toString second}" { ip4 =
+                  [ { address = "192.168.${toString first}.${toString m.second}";
+                      prefixLength = 24;
+                  } ];
+                }
             in
             { key = "ip-address";
               config =
@@ -60,7 +61,7 @@ rec {
                   networking.interfaces = listToAttrs interfaces;
 
                   networking.primaryIPAddress =
-                    optionalString (interfaces != []) (head interfaces).value.ipAddress;
+                    optionalString (interfaces != []) (head (head interfaces).value.ip4).address;
 
                   # Put the IP addresses of all VMs in this machine's
                   # /etc/hosts file.  If a machine has multiple