2024-07-27 07:06:52 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
2024-02-09 14:08:42 +00:00
|
|
|
services.minecraft-server = {
|
|
|
|
enable = true;
|
2024-07-28 10:07:21 +01:00
|
|
|
package = pkgs.papermcServers.papermc-1_20_4;
|
2024-02-09 14:08:42 +00:00
|
|
|
eula = true;
|
2024-03-10 08:07:05 +00:00
|
|
|
openFirewall = true;
|
2024-02-09 14:08:42 +00:00
|
|
|
declarative = true;
|
2024-07-27 07:06:52 +01:00
|
|
|
jvmOpts = "-Xmx4G -Xms4G";
|
2024-02-09 14:08:42 +00:00
|
|
|
whitelist = {
|
2024-03-10 08:07:05 +00:00
|
|
|
"pixelifytica" = "b1848d60-4ddd-4fa4-a328-fb269910b6ae";
|
2024-02-11 22:46:06 +00:00
|
|
|
"HomeInTheClouds" = "d49f0aee-f217-477b-9516-9d5906f7fc87";
|
2024-02-09 14:08:42 +00:00
|
|
|
};
|
|
|
|
serverProperties = {
|
2024-03-10 08:07:05 +00:00
|
|
|
server-port = 25565;
|
2024-02-11 22:46:06 +00:00
|
|
|
difficulty = "easy";
|
2024-02-09 14:08:42 +00:00
|
|
|
gamemode = "survival";
|
|
|
|
force-gamemode = true;
|
|
|
|
max-players = 10;
|
|
|
|
# level-seed = 238902389203;
|
|
|
|
motd = "NixOS Minecraft server!";
|
|
|
|
white-list = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-22 14:11:13 +00:00
|
|
|
# Caddy forwarding
|
2024-07-28 10:07:21 +01:00
|
|
|
services.caddy.virtualHosts = {
|
|
|
|
"craft.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:${toString config.services.minecraft-server.serverProperties.server-port}";
|
|
|
|
"bedrock.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:19132"};
|
2024-02-09 14:08:42 +00:00
|
|
|
}
|