anchor.diff:        "::1" = [ "localhost" ];
       };
   
  +    networking.hostFiles = let
  +      stringHosts =
  +        let
  +          oneToString = set: ip: ip + " " + concatStringsSep " " set.${ip} + "\n";
  +          allToString = set: concatMapStrings (oneToString set) (attrNames set);
  +        in pkgs.writeText "string-hosts" (allToString (filterAttrs (_: v: v != []) cfg.hosts));
  +      extraHosts = pkgs.writeText "extra-hosts" cfg.extraHosts;
  +    in mkBefore [ stringHosts extraHosts ];
  +
       environment.etc =
         { # /etc/services: TCP/UDP port assignments.
           services.source = pkgs.iana-etc + "/etc/services";
  
positive.code:       '';
      };
  
      networking.extraHosts = lib.mkOption {
        type = types.lines;
        default = "";
        example = "192.168.0.1 lanlocalhost";
        description = ''
          Additional verbatim entries to be appended to <filename>/etc/hosts</filename>.
        '';
      };
  
  
negative.code:         protocols.source  = pkgs.iana-etc + "/etc/protocols";
  
          # /etc/hosts: Hostname-to-IP mappings.
          hosts.source = pkgs.runCommandNoCC "hosts" {} ''
            cat ${escapeShellArgs cfg.hostFiles} > $out
          '';
  
          # /etc/host.conf: resolver configuration file
  