nixos/system/services/minecraft.nix

34 lines
941 B
Nix
Raw Normal View History

{
config,
pkgs,
...
}: {
2024-02-09 14:08:42 +00:00
services.minecraft-server = {
enable = true;
package = pkgs.papermcServers.papermc-1_20_4;
2024-02-09 14:08:42 +00:00
eula = true;
openFirewall = true;
2024-02-09 14:08:42 +00:00
declarative = true;
jvmOpts = "-Xmx4G -Xms4G";
2024-02-09 14:08:42 +00:00
whitelist = {
"pixelifytica" = "b1848d60-4ddd-4fa4-a328-fb269910b6ae";
"HomeInTheClouds" = "d49f0aee-f217-477b-9516-9d5906f7fc87";
2024-02-09 14:08:42 +00:00
};
serverProperties = {
server-port = 25565;
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
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
}