Added Survival Plugin and Velocity Server + Plugin
Some checks are pending
/ Check NixOS Configuration (push) Waiting to run

This commit is contained in:
Kaybee 2024-11-23 15:22:48 +01:00
parent c9509e103c
commit 0cdabbeedb
Signed by: kb01
SSH key fingerprint: SHA256:kF6CmkcOkKRzXK9JFMTQPK6b5gf5tHcJR1n2IS/Bj7M
4 changed files with 44 additions and 2 deletions

View file

@ -7,6 +7,7 @@ in
inputs.nix-minecraft.nixosModules.minecraft-servers inputs.nix-minecraft.nixosModules.minecraft-servers
./vanilla-test.nix ./vanilla-test.nix
./survival.nix ./survival.nix
./velocity.nix
]; ];
options.services.minecraft = { options.services.minecraft = {
@ -25,6 +26,11 @@ in
default = false; default = false;
description = "Survival Server"; description = "Survival Server";
}; };
servers.velocity.enable = lib.mkOption {
type = with lib.types; uniq bool;
default = false;
description = "Velocity Proxy Server";
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View file

@ -23,7 +23,13 @@ in
whitelist = { whitelist = {
kB01guy = "1ff88b66-beda-4386-85b9-a00a5c27437a"; kB01guy = "1ff88b66-beda-4386-85b9-a00a5c27437a";
}; };
openFirewall = true; serverProperties = {
difficulty = 3;
gamemode = 1;
max-players = 5;
};
openFirewall = false; # Should use Velocity Player Proxy
serverProperties.server-port = 41000;
symlinks = { symlinks = {
"plugins/LuckPerms.jar" = pkgs.fetchurl { url = "https://download.luckperms.net/1561/bukkit/loader/LuckPerms-Bukkit-5.4.146.jar"; sha512 = "3yx163xas6g30crj41ad8j9gh55ygfh7vbaq12hlm4rxf1npnxh95rhn2nx0qcjd4nl1rz8f8pbvmlh6ka32ahvn6x9rxsc8g6v24jz"; }; "plugins/LuckPerms.jar" = pkgs.fetchurl { url = "https://download.luckperms.net/1561/bukkit/loader/LuckPerms-Bukkit-5.4.146.jar"; sha512 = "3yx163xas6g30crj41ad8j9gh55ygfh7vbaq12hlm4rxf1npnxh95rhn2nx0qcjd4nl1rz8f8pbvmlh6ka32ahvn6x9rxsc8g6v24jz"; };
}; };

View file

@ -0,0 +1,30 @@
{
inputs,
config,
lib,
pkgs,
system,
...
}:
let
cfg = config.services.minecraft;
in
{
config = lib.mkIf (cfg.enable && cfg.servers.velocity.enable) {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"minecraft-server"
];
services.minecraft-servers.servers."velocity" = {
enable = true;
autoStart = true;
enableReload = true;
package = pkgs.velocityServers.velocity;
openFirewall = true;
symlinks = {
"plugins/LuckPerms.jar" = pkgs.fetchurl { url = "https://download.luckperms.net/1561/velocity/LuckPerms-Velocity-5.4.146.jar"; sha512 = "1xk7fwb5z3bz0x3hpmnyg7cldzrf9anpp4aavq5s69lz2idzxvkjn9b5iv2yy22p17k26lqwfn8n9ivi59srz2hvgdb1jibqg5d5hj5"; };
};
};
};
}

View file

@ -72,7 +72,7 @@
# Minecraft Servers # Minecraft Servers
services.minecraft = { services.minecraft = {
enable = true; enable = true;
servers.vanilla.enable = false; servers.velocity.enable = true;
servers.survival.enable = true; servers.survival.enable = true;
}; };