fix(servers): get 7days server to work again
All checks were successful
Discord / discord commits (push) Successful in 1m4s

This commit is contained in:
matt1432 2024-10-18 22:54:13 -04:00
parent 1987dbe35d
commit 715ab8337e

View file

@ -7,12 +7,29 @@ in {
startAt = "02/3:00"; startAt = "02/3:00";
}; };
nixpkgs.overlays = [
(final: prev: {
steam = prev.steam.override {
extraPreBwrapCmds = ''
mkdir -p "$HOME/.local/share/sevendays/"
'';
extraBwrapArgs = [
''--bind "${gamePath}/" "$HOME/.local/share/sevendays/"''
];
};
})
];
systemd = { systemd = {
extraConfig = "DefaultLimitNOFILE=10240"; extraConfig = "DefaultLimitNOFILE=10240";
services."7-days-to-die" = { services."7-days-to-die" = {
wantedBy = ["multi-user.target"]; wantedBy = ["multi-user.target"];
serviceConfig.User = "matt";
serviceConfig = {
User = "matt";
Group = "users";
};
path = builtins.attrValues { path = builtins.attrValues {
inherit inherit
@ -23,17 +40,14 @@ in {
}; };
script = '' script = ''
# Make sure gamePath exists and cd to it
mkdir -p ${gamePath}
cd ${gamePath}
# Install / Update server # Install / Update server
steamcmd +force_install_dir ${gamePath} \ steamcmd +force_install_dir "$HOME/.local/share/sevendays" \
+login anonymous +app_update 294420 \ +login anonymous +app_update 294420 \
+quit +quit
# Launch server # Launch server
steam-run ./startserver.sh -configfile=${relativeConfig} exec steam-run sh -c 'cd "$HOME/.local/share/sevendays"; \
exec ./startserver.sh -configfile=${relativeConfig}'
''; '';
}; };
}; };