remove lazymc due to complexity
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s

This commit is contained in:
Satria 2026-06-30 11:50:02 +08:00
commit 806f8d01de

View file

@ -20,59 +20,9 @@ in {
"vm.swappiness" = 10; "vm.swappiness" = 10;
}; };
systemd.services = { systemd.services."minecraft-server-${name}" = {
lazymc = let environment.LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; # physics toys mod fix
wrapperCommand = pkgs.writeShellScript "lazymc-${name}-wrapper" '' # serviceConfig.Nice = -5; # higher scheduling priority (causes fan noise even when idle)
#!/usr/bin/env bash
trap 'systemctl stop --wait "minecraft-server-${name}"; exit 0' SIGTERM
systemctl start "minecraft-server-${name}"
while systemctl is-active --quiet "minecraft-server-${name}"; do sleep 1; done
'';
config = {
public = {
address = "0.0.0.0:25565"; # external proxy port
version = "1.21.11";
};
server = {
wake_whitelist = true;
address = "127.0.0.1:25566"; # internal server port
directory = "/srv/minecraft/${name}";
command = wrapperCommand;
};
time.sleep_after = 600;
motd.from_server = true;
join = {
methods = [ "hold" ];
hold.timeout = 60;
};
rcon = {
enabled = true;
port = 25575;
password = rcon-pass;
randomize_password = false;
};
advanced.rewrite_server_properties = false; # might get overridden by nix-minecraft
config.version = "0.2.11";
};
in {
description = "Wake-up Proxy for Minecraft Server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "root";
Group = "root";
ExecStart = let
toml = pkgs.formats.toml {};
configFile = toml.generate "lazymc-${name}.toml" config;
in "${pkgs.lazymc}/bin/lazymc --config ${configFile}";
Restart = "always";
};
};
"minecraft-server-${name}" = {
environment.LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; # physics toys mod fix
# serviceConfig.Nice = -5; # higher scheduling priority
};
}; };
services.minecraft-servers = { services.minecraft-servers = {
@ -87,7 +37,7 @@ in {
servers.${name} = { servers.${name} = {
enable = true; enable = true;
autoStart = false; autoStart = true;
restart = "always"; restart = "always";
enableReload = production; enableReload = production;
@ -100,8 +50,8 @@ in {
}; };
serverProperties = { serverProperties = {
server-ip = "127.0.0.1"; server-ip = "0.0.0.0";
server-port = 25566; server-port = 25565;
server-name = name; server-name = name;
motd = "§cCan't connect to server"; motd = "§cCan't connect to server";
log-ips = true; log-ips = true;
@ -147,12 +97,8 @@ in {
"config/proxy_protocol_support.json".value = { "config/proxy_protocol_support.json".value = {
enableProxyProtocol = false; # polymer auto host has issues with proxy protocol enableProxyProtocol = false; # polymer auto host has issues with proxy protocol
whitelistTCPShieldServers = false; whitelistTCPShieldServers = false;
proxyServerIPs = [ proxyServerIPs = [ "127.0.0.1" "::1" ];
"127.0.0.1" "::1" directAccessIPs = [ "127.0.0.0/8" "::1/128" ];
];
directAccessIPs = [
"127.0.0.0/8" "::1/128" # localhost
];
}; };
}; };