Unverified Commit d6645716 authored by Maximilian Bosch's avatar Maximilian Bosch Committed by GitHub
Browse files

Merge pull request #256598 from adamcstephens/net/warn-multiple-net

nixos/networking: warn when both networkd and dhcpcd can collide
parents 080759b6 b4e162a1
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1344,7 +1344,10 @@ in

  config = {

    warnings = concatMap (i: i.warnings) interfaces;
    warnings = (concatMap (i: i.warnings) interfaces) ++ (lib.optional
      (config.systemd.network.enable && cfg.useDHCP && !cfg.useNetworkd) ''
        The combination of `systemd.network.enable = true`, `networking.useDHCP = true` and `networking.useNetworkd = false` can cause both networkd and dhcpcd to manage the same interfaces. This can lead to loss of networking. It is recommended you choose only one of networkd (by also enabling `networking.useNetworkd`) or scripting (by disabling `systemd.network.enable`)
      '');

    assertions =
      (forEach interfaces (i: {