anchor.diff:    resolvconfOptions = cfg.resolvconfOptions
       ++ optional cfg.dnsSingleRequest "single-request"
       ++ optional cfg.dnsExtensionMechanism "edns0";
  +
  +
  +  localhostMapped4 = cfg.hosts ? "127.0.0.1" && elem "localhost" cfg.hosts."127.0.0.1";
  +  localhostMapped6 = cfg.hosts ? "::1"       && elem "localhost" cfg.hosts."::1";
  +
  +  localhostMultiple = any (elem "localhost") (attrValues (removeAttrs cfg.hosts [ "127.0.0.1" "::1" ]));
  +
   in
   
   {
  
positive.code: 
    };
  
    }
  
negative.code: 
    config = {
  
      assertions = [{
        assertion = localhostMapped4;
        message = ''`networking.hosts` doesn't map "127.0.0.1" to "localhost"'';
      } {
        assertion = !cfg.enableIPv6 || localhostMapped6;
        message = ''`networking.hosts` doesn't map "::1" to "localhost"'';
      } {
        assertion = !localhostMultiple;
        message = ''
          `networking.hosts` maps "localhost" to something other than "127.0.0.1"
          or "::1". This will break some applications. Please use
          `networking.extraHosts` if you really want to add such a mapping.
        '';
      }];
  
      networking.hosts = {
        "127.0.0.1" = [ "localhost" ];
      } // optionalAttrs cfg.enableIPv6 {
        "::1" = [ "localhost" ];
      };
  
      environment.etc =
        { # /etc/services: TCP/UDP port assignments.
          "services".source = pkgs.iana-etc + "/etc/services";
  