feat(servers): reset 7days map and add auto backups
All checks were successful
Discord / discord commits (push) Successful in 38s

This commit is contained in:
matt1432 2024-07-13 22:12:35 -04:00
parent 031a36acdd
commit d13e984368
2 changed files with 34 additions and 22 deletions

View file

@ -2,33 +2,37 @@
gamePath = "/var/lib/steam-servers/7-days-to-die";
relativeConfig = "serverconfig-7days.xml";
in {
systemd.extraConfig = "DefaultLimitNOFILE=10240";
services.borgbackup.configs."seven-days" = {
paths = ["/var/lib/steam-servers/7-days-to-die"];
startAt = "02/3:00";
};
# TODO: make backups
systemd = {
extraConfig = "DefaultLimitNOFILE=10240";
# https://github.com/Krutonium/NewNix/blob/455aafc4caf553248ca228f844f021cecf494dc2/services/sevendaystodie.nix#L6
systemd.services."7-days-to-die" = {
wantedBy = ["multi-user.target"];
serviceConfig.User = "matt";
services."7-days-to-die" = {
wantedBy = ["multi-user.target"];
serviceConfig.User = "matt";
path = with pkgs; [
steam-run
steamcmd
];
path = with pkgs; [
steam-run
steamcmd
];
script = ''
# Make sure gamePath exists and cd to it
mkdir -p ${gamePath}
cd ${gamePath}
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 \
-beta latest_experimental \
+quit
# Install / Update server
steamcmd +force_install_dir ${gamePath} \
+login anonymous +app_update 294420 \
-beta latest_experimental \
+quit
# Launch server
steam-run ./startserver.sh -configfile=${relativeConfig}
'';
# Launch server
steam-run ./startserver.sh -configfile=${relativeConfig}
'';
};
};
}

View file

@ -9,12 +9,20 @@
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPijoxuSwH9IrS4poewzHHwe64UoX4QY7Qix5VhEdqKR root@servivi"
];
}
{
name = "mc";
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPijoxuSwH9IrS4poewzHHwe64UoX4QY7Qix5VhEdqKR root@servivi"
];
}
{
name = "seven-days";
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPijoxuSwH9IrS4poewzHHwe64UoX4QY7Qix5VhEdqKR root@servivi"
];
}
];
};
}