niksos/hosts/chmura/services/minecraft.nix

42 lines
1.1 KiB
Nix

{
pkgs,
...
}: {
services.minecraft-server = {
enable = false;
package = pkgs.purpur;
eula = true;
declarative = true;
jvmOpts = "";
serverProperties = {
server-ip = "192.168.15.17";
server-port = 2137;
difficulty = 3;
gamemode = 0;
enable-command-block = false;
hide-online-players = true;
level-name = "swiat";
max-players = 2;
online-mode = true;
snooper-enabled = false;
spawn-protection = 0;
view-distance = 12;
white-list = true;
enforce-whitelist = true;
};
whitelist = {
jacekpoz = "8cc45dd9-0145-4068-be30-038a3844ebd0";
krizej = "c456cd5a-489d-4c6e-9613-aa9735fe2843";
};
};
services.caddy = {
enable = true;
virtualHosts."mc.jacekpoz.pl".extraConfig = ''
reverse_proxy * localhost:2137
'';
};
networking.firewall.allowedTCPPorts = [ 2137 ];
networking.firewall.allowedUDPPorts = [ 2137 ];
}