enable vaheim

This commit is contained in:
stubbfelnewpc
2021-03-23 21:48:47 +01:00
parent 50f617abc7
commit 83660e400c
3 changed files with 34 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
{
environment.systemPackages = with pkgs; [
wget curl vim nano zsh fzf tmux git exa progress tldr htop
wget curl vim nano zsh fzf tmux git exa progress tldr htop steamcmd
];
imports =

View File

@@ -4,6 +4,7 @@
imports =
[
#./7dtd.nix
./vaheim.nix
./sshd.nix
./teamspeak.nix
./nginx.nix

32
services/vaheim.nix Normal file
View File

@@ -0,0 +1,32 @@
{ config, pkgs, ... }:
let
runEnv = (pkgs.buildFHSUserEnv {
name = "vaheim-env";
targetPkgs = pkgs: (with pkgs;
[
]);
runScript = "bash start_server.sh";
});
in
{
networking.firewall.allowedTCPPorts = [2456 2457 2458];
networking.firewall.allowedUDPPorts = [2456 2457 2458];
systemd.services.vaheim = {
description = "vaheim";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
User = "sshuser";
Group = "users";
WorkingDirectory = "/home/sshuser/.steam/root/valheim";
ExecStart = "${runEnv}/bin/vaheim-env";
Restart = "always";
};
};
}