networking.dhcpcd: Don't add to system closure when using networkd (#18436)
This commit is contained in:
parent
d320fbbd05
commit
06b2897c40
|
@ -10,7 +10,8 @@ let
|
||||||
|
|
||||||
interfaces = attrValues config.networking.interfaces;
|
interfaces = attrValues config.networking.interfaces;
|
||||||
|
|
||||||
enableDHCP = config.networking.useDHCP || any (i: i.useDHCP == true) interfaces;
|
enableDHCP = config.networking.dhcpcd.enable &&
|
||||||
|
(config.networking.useDHCP || any (i: i.useDHCP == true) interfaces);
|
||||||
|
|
||||||
# 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.
|
||||||
|
@ -85,6 +86,15 @@ in
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
networking.dhcpcd.enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Whether to enable dhcpcd for device configuration. This is mainly to
|
||||||
|
explicitly disable dhcpcd (for example when using networkd).
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
networking.dhcpcd.persistent = mkOption {
|
networking.dhcpcd.persistent = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
@ -43,7 +43,7 @@ in
|
||||||
message = "networking.bridges.${n}.rstp is not supported by networkd.";
|
message = "networking.bridges.${n}.rstp is not supported by networkd.";
|
||||||
});
|
});
|
||||||
|
|
||||||
systemd.services.dhcpcd.enable = mkDefault false;
|
networking.dhcpcd.enable = mkDefault false;
|
||||||
|
|
||||||
systemd.services.network-local-commands = {
|
systemd.services.network-local-commands = {
|
||||||
after = [ "systemd-networkd.service" ];
|
after = [ "systemd-networkd.service" ];
|
||||||
|
|
Loading…
Reference in New Issue