about 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-08-31 09:46:16 -0700
committerWilliam A. Kennington III <william@wkennington.com>2014-08-31 09:46:16 -0700
commit3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb (patch)
tree39f7a63253ae764835780f6305cf8bc5d8b109bc /nixos/lib/build-vms.nix
parent45c4e4d04adb79e21819d124b0156ac81ea3f760 (diff)
downloadnixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.tar
nixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.tar.gz
nixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.tar.bz2
nixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.tar.lz
nixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.tar.xz
nixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.tar.zst
nixlib-3d037ebb94f7c28dc7019a3332bf5d27f2cd9ebb.zip
Revert "Revert "Merge pull request #3182 from wkennington/master.ipv6""
This reverts commit ea8910652fcecbcd4f21aa1c66b1a0a239408b04.
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 498c0a377836..ba1895554096 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