{ minecraft, config, lib, ... }:
{
  imports = [
    minecraft.nixosModules.minecraft-servers
    ./servers/velocity
    ./servers/dewdemolisher
    ./servers/johnside
    ./servers/roguecraft
    ./servers/blockworld
    ./servers/uberbeta
  ];

  config = lib.mkIf config.system.server.enable {
    nixpkgs.overlays = [ minecraft.overlay ];

    services.minecraft-servers = {
      enable = true;
      eula = true;
    };

    environment.persistence."/persist".directories = [
      "/srv/minecraft"
    ];
  };
}
