{ pkgs, ... }:
{
  services.mysql = {
    enable = config.system.server.enable;
    package = pkgs.mariadb;
    dataDir = "/var/lib/mysql";
    ensureDatabases = [
      "minecraft"
      "photoprism"
    ];
    ensureUsers = [
      {
        name = "minecraft";
        ensurePermissions = {
          "minecraft.*" = "ALL PRIVILEGES";
        };
      }
      {
        name = "photoprism";
        ensurePermissions = {
          "photoprism.*" = "ALL PRIVILEGES";
        };
      }
    ];
  };
}
