anchor.diff:  let
     cfg = config.networking.networkmanager;
   
  -  # /var/lib/misc is for dnsmasq.leases.
  -  stateDirs = "/var/lib/NetworkManager /var/lib/dhclient /var/lib/misc";
  +  stateDirs = [
  +    "/var/lib/NetworkManager"
  +    "/var/lib/dhclient"
  +    "/var/lib/misc"  # dnsmasq leases
  +  ];
   
     configFile = pkgs.writeText "NetworkManager.conf" ''
       [main]
  
positive.code:     });
    '';
  
    ipUpScript = pkgs.writeScript "01nixos-network-online" ''
      #!/bin/sh
      if test "$2" = "up"; then
        ${config.systemd.package}/bin/systemctl start network-online.target
  
negative.code:     concatStrings (map (s: "nameserver ${s}\n") xs)
    );
  
    overrideNameserversScript = pkgs.writeScript "02-override-dns" ''
      #!/bin/sh
      tmp=`${pkgs.coreutils}/bin/mktemp`
      ${pkgs.gnused}/bin/sed '/nameserver /d' /etc/resolv.conf > $tmp
  