Turn networking.interfaces into an attribute set

Thus

  networking.interfaces = [ { name = "eth0"; ipAddress = "192.168.15.1"; } ];

can now be written as

  networking.interfaces.eth0.ipAddress = "192.168.15.1";

The old notation still works though.
This commit is contained in:
Eelco Dolstra
2012-11-02 17:08:11 +01:00
parent 93f82dfeef
commit 97f087cd44
7 changed files with 138 additions and 143 deletions

View File

@@ -16,7 +16,7 @@ let
miniupnpdConf = nodes: pkgs.writeText "miniupnpd.conf"
''
ext_ifname=eth1
listening_ip=${nodes.router.config.networking.ifaces.eth2.ipAddress}/24
listening_ip=${nodes.router.config.networking.interfaces.eth2.ipAddress}/24
allow 1024-65535 192.168.2.0/24 1024-65535
'';
@@ -49,7 +49,7 @@ in
{ environment.systemPackages = [ pkgs.transmission ];
virtualisation.vlans = [ 2 ];
networking.defaultGateway =
nodes.router.config.networking.ifaces.eth2.ipAddress;
nodes.router.config.networking.interfaces.eth2.ipAddress;
};
client2 =

View File

@@ -13,7 +13,7 @@
{ config, pkgs, nodes, ... }:
{ virtualisation.vlans = [ 1 ];
networking.defaultGateway =
nodes.router.config.networking.ifaces.eth2.ipAddress;
nodes.router.config.networking.interfaces.eth2.ipAddress;
};
router =