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:   options = {
  
      networking.hosts = lib.mkOption {
        type = types.attrsOf ( types.listOf types.str );
        default = {};
        example = literalExample ''
          {
            "127.0.0.1" = [ "foo.bar.baz" ];
  
negative.code:         "rpc".source = pkgs.glibc.out + "/etc/rpc";
  
          # /etc/hosts: Hostname-to-IP mappings.
          "hosts".text = let
            oneToString = set: ip: ip + " " + concatStringsSep " " set.${ip};
            allToString = set: concatMapStringsSep "\n" (oneToString set) (attrNames set);
          in ''
            ${allToString cfg.hosts}
            ${cfg.extraHosts}
          '';
  
          # /etc/host.conf: resolver configuration file
          "host.conf".text = cfg.hostConf;
  