nixos-configs/devices/servivi/modules/7-days-to-die.nix
matt1432 aac17cff3e
All checks were successful
Discord / discord commits (push) Successful in 59s
feat(servers): stop using beta for 7Days server
2024-07-25 15:20:23 -04:00

37 lines
879 B
Nix

{pkgs, ...}: let
gamePath = "/var/lib/steam-servers/7-days-to-die";
relativeConfig = "serverconfig-7days.xml";
in {
services.borgbackup.configs."seven-days" = {
paths = ["/var/lib/steam-servers/7-days-to-die"];
startAt = "02/3:00";
};
systemd = {
extraConfig = "DefaultLimitNOFILE=10240";
services."7-days-to-die" = {
wantedBy = ["multi-user.target"];
serviceConfig.User = "matt";
path = with pkgs; [
steam-run
steamcmd
];
script = ''
# Make sure gamePath exists and cd to it
mkdir -p ${gamePath}
cd ${gamePath}
# Install / Update server
steamcmd +force_install_dir ${gamePath} \
+login anonymous +app_update 294420 \
+quit
# Launch server
steam-run ./startserver.sh -configfile=${relativeConfig}
'';
};
};
}