75 lines
2.8 KiB
Nix
75 lines
2.8 KiB
Nix
{
|
|
inputs,
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
system,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.services.minecraft;
|
|
in
|
|
{
|
|
config = lib.mkIf (cfg.enable && cfg.servers.velocity.enable) {
|
|
|
|
# Configure Server
|
|
services.minecraft-servers.servers."velocity" = {
|
|
enable = true;
|
|
autoStart = true;
|
|
enableReload = true;
|
|
stopCommand = "end";
|
|
package = pkgs.velocityServers.velocity;
|
|
symlinks = {
|
|
"plugins/LuckPerms.jar" = pkgs.fetchurl {
|
|
url = "https://download.luckperms.net/1567/velocity/LuckPerms-Velocity-5.4.150.jar";
|
|
sha512 = "3dr69g2fbav3if44nmifgz7hn86gdf62hcks92kkvwxf4xa3z7x615j426kgljyhgy84hf75wzpai258mg7dj9x17vpkn634kkzwmw6";
|
|
};
|
|
"plugins/Geyser-Velocity.jar" = pkgs.fetchurl {
|
|
url = "https://download.geysermc.org/v2/projects/geyser/versions/2.6.0/builds/730/downloads/velocity";
|
|
sha512 = "3shnm8q8vq8j44xxg4qwqwalw6ml9nkzfrzvv8pkblkjp25nfk3h14b4y9vdim1sa2a18mkf8hmhb16g1mka2rh7l0z0yg4kh3lj2i0";
|
|
};
|
|
"plugins/floodgate-velocity.jar" = pkgs.fetchurl {
|
|
url = "https://download.geysermc.org/v2/projects/floodgate/versions/2.2.3/builds/114/downloads/velocity";
|
|
sha512 = "1k7qban3gar0fxxi5kp5i8d72k6ck65cvsfbg4nh8bz40jwqn35fx9gj3zbb06x5l8sg6qxl7w2nsn3jan4hjq7m5lwf2c1l1mjaw81";
|
|
};
|
|
"plugins/LibreLogin.jar" = pkgs.fetchurl {
|
|
url = "https://modrinth.com/plugin/libre-login/version/0.23.0";
|
|
sha512 = "1wrnp82vv47hhvjp1lxdndmngndykshi7iindnpg61j0v7i8bdgr9rk5qvanvw95gcj59cnhxdmjynq8fm127n4gv53acdidlxz39sd";
|
|
};
|
|
};
|
|
files = {
|
|
"velocity.toml".value = {
|
|
config-version = "2.7"; # NEVER change this!
|
|
bind = "0.0.0.0:25565";
|
|
online-mode = false;
|
|
player-info-forwarding-mode = "modern";
|
|
enable-player-address-logging = false;
|
|
# servers.lobby = "";
|
|
servers.survival = "127.0.0.1:${toString config.services.minecraft-servers.servers."survival".serverProperties.server-port}";
|
|
servers.lobby = "127.0.0.1:123";
|
|
servers.try = [
|
|
#"lobby"
|
|
"survival"
|
|
];
|
|
forced-hosts."lobby.example.com" = [ "lobby" ];
|
|
advanced.tcp-fast-open = true;
|
|
};
|
|
};
|
|
};
|
|
networking.firewall.allowedTCPPorts = [ 25565 ];
|
|
|
|
# Configure Plugin Luckperms
|
|
sops.templates."minecraft/velocity/plugin/luckperms/config.yml".path = "/srv/minecraft/velocity/plugins/luckperms/config.yml";
|
|
sops.templates."minecraft/velocity/plugin/luckperms/config.yml".content = ''
|
|
storage-method: mariadb
|
|
data:
|
|
address: localhost:${toString config.services.mysql.settings.mysqld.port}
|
|
database: luckperms
|
|
username: luckperms
|
|
password: ${config.sops.placeholder."minecraft/database/luckperms_password"}
|
|
'';
|
|
|
|
|
|
};
|
|
}
|
|
|