nixos/services/minecraft.nix

26 lines
757 B
Nix

{config, ...}: {
services.minecraft-server = {
enable = true;
eula = true;
openFirewall = true;
declarative = true;
whitelist = {
"pixelifytica" = "b1848d60-4ddd-4fa4-a328-fb269910b6ae";
"HomeInTheClouds" = "d49f0aee-f217-477b-9516-9d5906f7fc87";
};
serverProperties = {
server-port = 25565;
difficulty = "easy";
gamemode = "survival";
force-gamemode = true;
max-players = 10;
# level-seed = 238902389203;
motd = "NixOS Minecraft server!";
white-list = true;
};
};
# Caddy forwarding
services.caddy.virtualHosts."craft.xenia.me.uk".extraConfig = "reverse_proxy http://localhost:${toString config.services.minecraft-server.serverProperties.server-port}";
}