* 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:
@@ -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.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user