Author: simons
Date: Tue May  8 11:46:01 2012
New Revision: 34018
URL: https://nixos.org/websvn/nix/?rev=34018&sc=1

Log:
Added 'networking.dhcpcd.denyInterfaces' to extend the list of network
interfaces black-listed for dhcpcd via configuration.nix. I use this option to
disable DHCP for "veth*" interfaces, which are created by LXC for use inside of
virtual machines.

Modified:
   nixos/trunk/modules/services/networking/dhcpcd.nix

Modified: nixos/trunk/modules/services/networking/dhcpcd.nix
==============================================================================
--- nixos/trunk/modules/services/networking/dhcpcd.nix  Tue May  8 11:36:04 
2012        (r34017)
+++ nixos/trunk/modules/services/networking/dhcpcd.nix  Tue May  8 11:46:01 
2012        (r34018)
@@ -10,7 +10,8 @@
   # interfaces that are part of a bridge.
   ignoredInterfaces =
     map (i: i.name) (filter (i: i ? ipAddress && i.ipAddress != "" ) 
config.networking.interfaces)
-    ++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) 
config.networking.bridges));
+    ++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) 
config.networking.bridges))
+    ++ config.networking.dhcpcd.denyInterfaces;
 
   # Config file adapted from the one that ships with dhcpcd.
   dhcpcdConf = pkgs.writeText "dhcpcd.conf"
@@ -70,6 +71,23 @@
 
 {
 
+  ###### interface
+
+  options = {
+
+    networking.dhcpcd.denyInterfaces = mkOption {
+      default = [];
+      description = ''
+         Disable the DHCP client for any interface which's name matches
+         any of the shell glob patterns in this list. The purpose of
+         this option is blacklist virtual interfaces such as those
+         created by Xen, libvirt, LXC, etc.
+      '';
+    };
+
+  };
+
+
   ###### implementation
 
   config = mkIf config.networking.useDHCP {
_______________________________________________
nix-commits mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-commits

Reply via email to