Merge pull request #3200 from wkennington/master.dhcpcd
nixos/dhcpcd: Add an explicit interfaces option
This commit is contained in:
commit
c42e7dfc0c
@ -6,6 +6,8 @@ let
|
|||||||
|
|
||||||
dhcpcd = if !config.boot.isContainer then pkgs.dhcpcd else pkgs.dhcpcd.override { udev = null; };
|
dhcpcd = if !config.boot.isContainer then pkgs.dhcpcd else pkgs.dhcpcd.override { udev = null; };
|
||||||
|
|
||||||
|
cfg = config.networking.dhcpcd;
|
||||||
|
|
||||||
# Don't start dhcpcd on explicitly configured interfaces or on
|
# Don't start dhcpcd on explicitly configured interfaces or on
|
||||||
# interfaces that are part of a bridge, bond or sit device.
|
# interfaces that are part of a bridge, bond or sit device.
|
||||||
ignoredInterfaces =
|
ignoredInterfaces =
|
||||||
@ -38,7 +40,10 @@ let
|
|||||||
# (Xen) and virbr* and vnet* (libvirt).
|
# (Xen) and virbr* and vnet* (libvirt).
|
||||||
denyinterfaces ${toString ignoredInterfaces} lo peth* vif* tap* tun* virbr* vnet* vboxnet* sit*
|
denyinterfaces ${toString ignoredInterfaces} lo peth* vif* tap* tun* virbr* vnet* vboxnet* sit*
|
||||||
|
|
||||||
${config.networking.dhcpcd.extraConfig}
|
# Use the list of allowed interfaces if specified
|
||||||
|
${optionalString (cfg.allowInterfaces != null) "allowinterfaces ${toString cfg.allowInterfaces}"}
|
||||||
|
|
||||||
|
${cfg.extraConfig}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Hook for emitting ip-up/ip-down events.
|
# Hook for emitting ip-up/ip-down events.
|
||||||
@ -81,6 +86,17 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.dhcpcd.allowInterfaces = mkOption {
|
||||||
|
type = types.nullOr (types.listOf types.str);
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Enable the DHCP client for any interface whose name matches
|
||||||
|
any of the shell glob patterns in this list. Any interface not
|
||||||
|
explicitly matched by this pattern will be denied. This pattern only
|
||||||
|
applies when non-null.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
networking.dhcpcd.extraConfig = mkOption {
|
networking.dhcpcd.extraConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user