nixos/services/game-servers.nix

30 lines
911 B
Nix
Raw Normal View History

2026-01-20 19:53:42 +00:00
{ config, pkgs, lib, ... }:
{
2026-01-25 12:35:18 +00:00
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
## <----- HYTALE ----> ##
virtualisation.oci-containers = {
backend = "docker";
containers."hytale" = {
image = "indifferentbroccoli/hytale-server-docker:latest";
ports = [ "5520:5520/udp" ];
environment = {
SERVER_NAME = "Nordhammer.it Hytale Server";
MAX_PLAYERS = "50";
ENABLE_BACKUP = "true";
BACKUP_FREQUENCY = "30";
PASSWORD = "DukeSmells";
};
volumes = [
"/home/fred/docker/hytale-server/hytale-data:/home/hytale/server-files"
];
extraOptions = [
"--stop-timeout=30"
2026-01-25 12:49:15 +00:00
"--memory=16g" # Docker memory limit
"--memory-swap=16g" # Prevent swap usage
2026-01-25 12:35:18 +00:00
];
};
};
networking.firewall.allowedUDPPorts = [ 5520 ];
};
2026-01-20 19:53:42 +00:00
}