even more backups of things
This commit is contained in:
parent
b8d125d448
commit
630f9b0074
46 changed files with 1166 additions and 197 deletions
50
hosts/lithium/microvms/valheim.nix
Normal file
50
hosts/lithium/microvms/valheim.nix
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
microvm.vms.valheim = {
|
||||
autoStart = true;
|
||||
memorySize = 4096;
|
||||
vcpu = 2;
|
||||
|
||||
forwardPorts = [
|
||||
{ from = "host"; hostPort = 2456; guestPort = 2456; proto = "udp"; }
|
||||
{ from = "host"; hostPort = 2457; guestPort = 2457; proto = "udp"; }
|
||||
];
|
||||
|
||||
# NOTE: For games with large save files, choose a path in "/tank" for
|
||||
# storage.
|
||||
sharedDirectories = [
|
||||
{
|
||||
hostPath = "/srv/game-data-valheim";
|
||||
guestPath = "/data";
|
||||
tag = "valheim-data";
|
||||
readOnly = false;
|
||||
}
|
||||
];
|
||||
|
||||
packages = [ pkgs.steamcmd pkgs.steam-run ];
|
||||
|
||||
users.users.valheim = {
|
||||
isNormalUser = true;
|
||||
home = "/home/valheim";
|
||||
extraGroups = [ "wheel" ];
|
||||
};
|
||||
|
||||
systemd.services.valheim = {
|
||||
description = "Valheim Dedicated Server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
workingDirectory = "/data";
|
||||
ExecStart = ''
|
||||
${pkgs.steam-run}/bin/steam-run ./valheim_server.x86_64 \
|
||||
-name "Valheim NixOS" \
|
||||
-port 2456 \
|
||||
-world "FlatEarth" \
|
||||
-password "secret" \
|
||||
-public 1
|
||||
'';
|
||||
Restart = "always";
|
||||
User = "valheim";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue