anchor.diff:          $wgDebugLogFile = "/tmp/mediawiki_debug_log.txt";
   
           # Database configuration.
  -        $wgDBtype = "postgres";
  -        $wgDBserver = "";
  -        $wgDBuser = "wwwrun";
  -        $wgDBname = "mediawiki";
  +        $wgDBtype = "${config.dbType}";
  +        $wgDBserver = "${config.dbServer}";
  +        $wgDBuser = "${config.dbUser}";
  +        $wgDBpassword = "${config.dbPassword}";
  +        $wgDBname = "${config.dbName}";
   
  -        $wgEmergencyContact = "${serverInfo.serverConfig.adminAddr}";
  -        $wgPasswordSender = $wgEmergencyContact;
  +        # E-mail.
  +        $wgEmergencyContact = "${config.emergencyContact}";
  +        $wgPasswordSender = "${config.passwordSender}";
  +
  +        $wgSitename = "${config.siteName}";
  +
  +        ${config.extraConfig}
         ?>
       '';
   
  
positive.code:       '';
      };
  
    };
  
    startupScript = pkgs.writeScript "mediawiki_startup.sh"
      ''
        if ! ${pkgs.postgresql}/bin/psql -l | grep -q ' mediawiki ' ; then
            ${pkgs.postgresql}/bin/createuser --no-superuser --no-createdb --no-createrole wwwrun || true
            ${pkgs.postgresql}/bin/createdb mediawiki -O wwwrun
            ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} wwwrun -c "(echo 'CREATE LANGUAGE plpgsql;'; cat /nix/store/q9gdf3f4362yhsdi8inlhpk26d9b8af6-mediawiki-1.15.1/maintenance/postgres/tables.sql; echo 'CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.english );'; echo COMMIT) | ${pkgs.postgresql}/bin/psql mediawiki"
        fi
      '';
  }
  
negative.code: 
    options = {
  
      dbType = mkOption {
        default = "postgres";
        example = "mysql";
        description = "Database type.";
      };
  
      dbName = mkOption {
        default = "mediawiki";
        description = "Name of the database that holds the MediaWiki data.";
      };
      
      dbServer = mkOption {
        default = ""; # use a Unix domain socket
        example = "10.0.2.2";
        description = ''
  	The location of the database server.  Leave empty to use a
          database server running on the same machine through a Unix
          domain socket.
        '';
      };
  
      dbUser = mkOption {
        default = "wwwrun";
        example = "mediawiki";
        description = "The user name for accessing the database.";
      };
      
      dbPassword = mkOption {
        default = "";
        example = "foobar";
        description = ''
          The password of the database user.  Warning: this is stored in
          cleartext in the Nix store!
        '';
      };
      
      emergencyContact = mkOption {
        default = serverInfo.serverConfig.adminAddr;
        example = "admin@example.com";
        description = ''
          Emergency contact e-mail address.  Defaults to the Apache
          admin address.
        '';
      };
      
      passwordSender = mkOption {
        default = serverInfo.serverConfig.adminAddr;
        example = "password@example.com";
        description = ''
          E-mail address from which password confirmations originate.
          Defaults to the Apache admin address.
        '';
      };
  
      siteName = mkOption {
        default = "MediaWiki";
        example = "Foobar Wiki";
        description = "Name of the wiki";
      };
  
      urlPrefix = mkOption {
        example = "/wiki";
  