anchor.diff:      };
   
     };
  +
  +  localhostWithDomain = optionalString (cfg.domain != "")
  +    "localhost.${cfg.domain}";
  +
  +  hostnameWithDomain = optionalString
  +    (cfg.domain != "" && cfg.hostName != "")
  +    "${cfg.hostName}.${cfg.domain}";
   
   in
   
  
positive.code: 
  {config, pkgs, ...}:
  
  let
  
    options = {
  
  
negative.code:       { # /etc/hosts: Hostname-to-IP mappings.
          source = pkgs.writeText "hosts"
            ''
              ${cfg.extraHosts}
              ${optionalString (cfg.hostName != "")
                "127.0.0.1 ${cfg.hostName} ${hostnameWithDomain}"}
              127.0.0.1 localhost ${localhostWithDomain}
            '';
          target = "hosts";
        }
  