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.

svn path=/nixos/trunk/; revision=34018
This commit is contained in:
Peter Simons 2012-05-08 11:46:01 +00:00
parent 1a0c9ce201
commit 7a69733704

View file

@ -10,7 +10,8 @@ let
# 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 @@ in
{
###### 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 {