anchor.diff:      [service]
       DISABLE_REGISTRATION = ${boolToString cfg.disableRegistration}
   
  +    ${optionalString (cfg.mailerPasswordFile != null) ''
  +      [mailer]
  +      PASSWD = #mailerpass#
  +    ''}
  +
       ${cfg.extraConfig}
     '';
   in
  
positive.code:           KEY="$(head -n1 ${secretKey})"
            DBPASS="$(head -n1 ${cfg.database.passwordFile})"
            JWTSECRET="$(head -n1 ${jwtSecret})"
            sed -e "s,#secretkey#,$KEY,g" \
                -e "s,#dbpass#,$DBPASS,g" \
                -e "s,#jwtsecet#,$JWTSECET,g" \
                -i ${runConfig}
            chmod 640 ${runConfig} ${secretKey} ${jwtSecret}
          ''}
  
negative.code:         description = "Upper level of template and static files path.";
        };
  
        mailerPasswordFile = mkOption {
          type = types.nullOr types.str;
          default = null;
          example = "/var/lib/secrets/gitea/mailpw";
          description = "Path to a file containing the SMTP password.";
        };
  
        disableRegistration = mkEnableOption "the registration lock" // {
          description = ''
            By default any user can create an account on this <literal>gitea</literal> instance.
  