anchor.diff:          '';
         };
   
  +      settings = mkOption {
  +        type = with types; attrsOf (attrsOf (oneOf [ bool int str ]));
  +        default = {};
  +        description = ''
  +          Gitea configuration. Refer to <link xlink:href="https://docs.gitea.io/en-us/config-cheat-sheet/"/>
  +          for details on supported values.
  +        '';
  +        example = literalExample ''
  +          {
  +            "cron.sync_external_users" = {
  +              RUN_AT_START = true;
  +              SCHEDULE = "@every 24h";
  +              UPDATE_EXISTING = true;
  +            };
  +            mailer = {
  +              ENABLED = true;
  +              MAILER_TYPE = "sendmail";
  +              FROM = "do-not-reply@example.org";
  +              SENDMAIL_PATH = "${pkgs.system-sendmail}/bin/sendmail";
  +            };
  +            other = {
  +              SHOW_FOOTER_VERSION = false;
  +            };
  +          }
  +        '';
  +      };
  +
         extraConfig = mkOption {
  -        type = types.str;
  -        default = "";
  +        type = with types; nullOr str;
  +        default = null;
           description = "Configuration lines appended to the generated gitea configuration file.";
         };
       };
  
positive.code:         message = "services.gitea.database.user must match services.gitea.user if the database is to be automatically provisioned";
        }
      ];
  
      services.postgresql = optionalAttrs (usePostgresql && cfg.database.createDatabase) {
        enable = mkDefault true;
  
negative.code: 
      users.groups.gitea = {};
  
      warnings =
        optional (cfg.database.password != "") ''
          config.services.gitea.database.password will be stored as plaintext in the Nix store. Use database.passwordFile instead.'' ++
        optional (cfg.extraConfig != null) ''
          services.gitea.`extraConfig` is deprecated, please use services.gitea.`settings`.
        '';
  
      # Create database passwordFile default when password is configured.
      services.gitea.database.passwordFile =
  