summary refs log tree commit diff
path: root/modules/tasks/network-interfaces.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2010-05-21 14:12:03 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2010-05-21 14:12:03 +0000
commitfa183e54723e62f015813b01f848e855297d1538 (patch)
treea5d8915a25a394f54ae420c7188600287a9a5936 /modules/tasks/network-interfaces.nix
parent3c7a6eb53cb9895225e705544b3289e3cd79bedd (diff)
downloadnixpkgs-fa183e54723e62f015813b01f848e855297d1538.tar
nixpkgs-fa183e54723e62f015813b01f848e855297d1538.tar.gz
nixpkgs-fa183e54723e62f015813b01f848e855297d1538.tar.bz2
nixpkgs-fa183e54723e62f015813b01f848e855297d1538.tar.lz
nixpkgs-fa183e54723e62f015813b01f848e855297d1538.tar.xz
nixpkgs-fa183e54723e62f015813b01f848e855297d1538.tar.zst
nixpkgs-fa183e54723e62f015813b01f848e855297d1538.zip
* 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
Diffstat (limited to 'modules/tasks/network-interfaces.nix')
-rw-r--r--modules/tasks/network-interfaces.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/tasks/network-interfaces.nix b/modules/tasks/network-interfaces.nix
index 28372450f24..836950f42a6 100644
--- a/modules/tasks/network-interfaces.nix
+++ b/modules/tasks/network-interfaces.nix
@@ -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.
+      '';
+    };
+    
   };