anchor.diff:        denyinterfaces ${toString ignoredInterfaces} lo peth* vif* tap* tun* virbr* vnet* vboxnet* sit*
   
         # Use the list of allowed interfaces if specified
  -      ${optionalString (cfg.allowInterfaces != null) "allowinterfaces ${toString cfg.allowInterfaces}"}
  +      ${optionalString (allowInterfaces != null) "allowinterfaces ${toString allowInterfaces}"}
   
         ${cfg.extraConfig}
       '';
  
positive.code: 
    ###### implementation
  
    config = mkIf config.networking.useDHCP {
  
      systemd.services.dhcpcd =
        { description = "DHCP Client";
  
negative.code: 
    cfg = config.networking.dhcpcd;
  
    interfaces = attrValues config.networking.interfaces;
  
    enableDHCP = 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.
    ignoredInterfaces =
      map (i: i.name) (filter (i: if i.useDHCP != null then i.useDHCP else i.ip4 != [ ] || i.ipAddress != null) interfaces)
      ++ mapAttrsToList (i: _: i) config.networking.sits
      ++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bridges))
      ++ concatLists (attrValues (mapAttrs (n: v: v.interfaces) config.networking.bonds))
      ++ config.networking.dhcpcd.denyInterfaces;
  
    arrayAppendOrNull = a1: a2: if a1 == null && a2 == null then null
      else if a1 == null then a2 else if a2 == null then a1
        else a1 ++ a2;
  
    # If dhcp is disabled but explicit interfaces are enabled,
    # we need to provide dhcp just for those interfaces.
    allowInterfaces = arrayAppendOrNull cfg.allowInterfaces
      (if !cfg.useDHCP && enableDHCP then map (i: i.name) (filter (i: i.useDHCP == true) interfaces) else null);
  
    # Config file adapted from the one that ships with dhcpcd.
    dhcpcdConf = pkgs.writeText "dhcpcd.conf"
  