remove lazymc due to complexity
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 28s
This commit is contained in:
parent
a625259f20
commit
806f8d01de
1 changed files with 8 additions and 62 deletions
|
|
@ -20,59 +20,9 @@ in {
|
||||||
"vm.swappiness" = 10;
|
"vm.swappiness" = 10;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services."minecraft-server-${name}" = {
|
||||||
lazymc = let
|
|
||||||
wrapperCommand = pkgs.writeShellScript "lazymc-${name}-wrapper" ''
|
|
||||||
#!/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
|
environment.LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib"; # physics toys mod fix
|
||||||
# serviceConfig.Nice = -5; # higher scheduling priority
|
# serviceConfig.Nice = -5; # higher scheduling priority (causes fan noise even when idle)
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
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
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue