34 lines
1,009 B
Nix
34 lines
1,009 B
Nix
{ config, pkgs, lib, ... }:
|
|
{
|
|
config = lib.mkIf (config.networking.hostName == "FredOS-Mediaserver") {
|
|
## <----- HYTALE ----> ##
|
|
systemd.services.hytale-server = {
|
|
description = "Hytale Dedicated Server";
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network.target" ];
|
|
|
|
path = with pkgs; [ bash jdk unzip gawk gnugrep coreutils ]; # Add required tools
|
|
|
|
environment = {
|
|
HYTALE_MEMORY = "8G"; # Adjust memory allocation here
|
|
};
|
|
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
User = "fred";
|
|
Group = "users";
|
|
WorkingDirectory = "/home/fred/docker/hytale-server/Server";
|
|
ExecStart = "/home/fred/docker/hytale-server/start-hytale.sh";
|
|
Restart = "on-failure";
|
|
RestartSec = "10s";
|
|
TimeoutStopSec = "30s";
|
|
|
|
# Security hardening
|
|
NoNewPrivileges = true;
|
|
PrivateTmp = true;
|
|
};
|
|
};
|
|
|
|
networking.firewall.allowedUDPPorts = [ 5520 ];
|
|
};
|
|
}
|