anchor.diff:        ++ lib.imap1 (i: s: {
           inherit (s) source;
           target = "NetworkManager/dispatcher.d/${dispatcherTypesSubdirMap.${s.type}}03userscript${lib.fixedWidthNumber 4 i}";
  -      }) cfg.dispatcherScripts;
  +      }) cfg.dispatcherScripts
  +      ++ optional (dynamicHostsEnabled)
  +           { target = "NetworkManager/dnsmasq.d/dyndns.conf";
  +             text = concatMapStrings (n: ''
  +               hostsdir=/run/NetworkManager/hostsdirs/${n}
  +             '') (attrNames cfg.dynamicHosts.hostsDirs);
  +           };
   
       environment.systemPackages = cfg.packages;
   
  
positive.code: 
    config = mkIf cfg.enable {
  
      assertions = [{
        assertion = config.networking.wireless.enable == false;
        message = "You can not use networking.networkmanager with networking.wireless";
      }];
  
      environment.etc = with cfg.basePackages; [
        { source = configFile;
  
negative.code: 
  let
    cfg = config.networking.networkmanager;
  
    dynamicHostsEnabled =
      cfg.dynamicHosts.enable && cfg.dynamicHosts.hostsDirs != {};
  
    # /var/lib/misc is for dnsmasq.leases.
    stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc";
  