server.nix/games/palworld.nix

50 lines
1.4 KiB
Nix

{ settings
, ...
}: let
serverPort = 8211;
steamQueryPort = 27015;
in {
virtualisation.oci-containers.containers.palworld = {
autoStart = true;
image = "thijsvanloef/palworld-server-docker:latest";
ports = [
"${toString serverPort}:${toString serverPort}/udp" # server
"${toString steamQueryPort}:27015/udp" # QUERY_PORT for steam server? Whatever that is, has to be exposed
# "8212:8212/tcp" # Uncomment this line if REST API is enabled
];
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Europe/Tallinn";
PORT = toString serverPort;
PLAYERS = "16";
MULTITHREADING = "true";
RCON_ENABLED = "true";
RCON_PORT = "25575";
COMMUNITY = "false"; # Change this to "true" if you want the server to show up in community servers tab
SERVER_NAME = "catnip.ee server";
SERVER_DESCRIPTION = "meow meow meow";
# Inside /etc/secrets/palworld.env
# ADMIN_PASSWORD = "adminPasswordHere";
# SERVER_PASSWORD = "worldofpals";
};
environmentFiles = [
"/etc/secrets/palworld.env"
];
volumes = [
"${settings.server_configs_home}/palworld:/palworld"
];
};
networking.firewall.allowedUDPPorts = [
serverPort
steamQueryPort
];
services.borgbackup.jobs."borgbase".paths = [
"/home/owo/Documents/server_configs/palworld"
];
}