even more backups of things
This commit is contained in:
parent
b8d125d448
commit
630f9b0074
46 changed files with 1166 additions and 197 deletions
42
hosts/lithium/services/game_servers.nix
Normal file
42
hosts/lithium/services/game_servers.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
# TODO
|
||||
# systemd.services.<name>.serviceConfig.{MemoryMax,CPUQuota}
|
||||
systemd.services.valheim-server = {
|
||||
description = "Valheim dedicated server";
|
||||
after = [ "network.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "valheim";
|
||||
Group = "valheim";
|
||||
ExecStart = "${pkgs.steamcmd}/bin/steamcmd +login anonymous +force_install_dir /home/valheim/server +app_update 896660 validate +exit && /home/valheim/server/valheim_server.x86_64";
|
||||
};
|
||||
|
||||
users.users.valheim = {
|
||||
isSystemUser = true;
|
||||
group = "valheim";
|
||||
home = "/home/valheim";
|
||||
};
|
||||
users.groups.valheim = {};
|
||||
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ 7777 2456 ];
|
||||
allowedUDPPorts = [ 7777 2457 ];
|
||||
};
|
||||
|
||||
services.restic.backups.gameservers = {
|
||||
user = "root";
|
||||
# TODO: Pick a real backup directory.
|
||||
repository = "/backup/gameservers";
|
||||
paths = [
|
||||
"/var/lib/terraria"
|
||||
"/home/valheim/server"
|
||||
];
|
||||
timeConfig = {
|
||||
OnCalendar = "daily";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue