summary refs log tree commit diff
path: root/nixos/modules/services/networking/dhcpcd.nix
diff options
context:
space:
mode:
authorAlexander Ried <ried@mytum.de>2016-09-13 07:55:17 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2016-09-13 07:55:17 +0200
commit06b2897c4049f62da3c5fb08a5ae788bf051cbc7 (patch)
tree7ba5a5b183cbc8ba22d7bfc11723be4736fd20a0 /nixos/modules/services/networking/dhcpcd.nix
parentd320fbbd055fccf14ed2882baff2842b8e87a213 (diff)
downloadnixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.tar
nixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.tar.gz
nixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.tar.bz2
nixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.tar.lz
nixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.tar.xz
nixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.tar.zst
nixpkgs-06b2897c4049f62da3c5fb08a5ae788bf051cbc7.zip
networking.dhcpcd: Don't add to system closure when using networkd (#18436)
Diffstat (limited to 'nixos/modules/services/networking/dhcpcd.nix')
-rw-r--r--nixos/modules/services/networking/dhcpcd.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/networking/dhcpcd.nix b/nixos/modules/services/networking/dhcpcd.nix
index 49d74dfdf0f..4b0e9088651 100644
--- a/nixos/modules/services/networking/dhcpcd.nix
+++ b/nixos/modules/services/networking/dhcpcd.nix
@@ -10,7 +10,8 @@ let
 
   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
   # interfaces that are part of a bridge, bond or sit device.
@@ -85,6 +86,15 @@ in
 
   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 {
       type = types.bool;
       default = false;