* Expose networking.interfaces as an attribute set keyed on the
interface name through the derived option networking.ifaces. This makes it easier to get information about specific interfaces (e.g. `nodes.router.config.networking.ifaces.eth2.ipAddress'). Really networking.interfaces should be an attribute set. svn path=/nixos/trunk/; revision=21938
This commit is contained in:
parent
3c7a6eb53c
commit
fa183e5472
@ -117,6 +117,16 @@ in
|
||||
|
||||
};
|
||||
|
||||
networking.ifaces = mkOption {
|
||||
default = listToAttrs
|
||||
(map (iface: { name = iface.name; value = iface; }) config.networking.interfaces);
|
||||
internal = true;
|
||||
description = ''
|
||||
The network interfaces in <option>networking.interfaces</option>
|
||||
as an attribute set keyed on the interface name.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -42,10 +42,11 @@ in
|
||||
};
|
||||
|
||||
client1 =
|
||||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, nodes, ... }:
|
||||
{ environment.systemPackages = [ pkgs.transmission ];
|
||||
virtualisation.vlans = [ 2 ];
|
||||
networking.defaultGateway = "192.168.2.3"; # !!! ugly
|
||||
networking.defaultGateway =
|
||||
nodes.router.config.networking.ifaces.eth2.ipAddress;
|
||||
};
|
||||
|
||||
client2 =
|
||||
|
@ -10,9 +10,10 @@
|
||||
|
||||
nodes =
|
||||
{ client =
|
||||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, nodes, ... }:
|
||||
{ virtualisation.vlans = [ 1 ];
|
||||
networking.defaultGateway = "192.168.1.2"; # !!! ugly
|
||||
networking.defaultGateway =
|
||||
nodes.router.config.networking.ifaces.eth2.ipAddress;
|
||||
};
|
||||
|
||||
router =
|
||||
|
Loading…
x
Reference in New Issue
Block a user