nixos/terraria: prefer 'serviceConfig' over 'chmod/chgrp'

This commit is contained in:
Felix Buehler 2024-02-04 21:17:01 +01:00
parent 237e77803e
commit 016340590b

View File

@ -148,16 +148,13 @@ in
serviceConfig = {
User = "terraria";
Group = "terraria";
Type = "forking";
GuessMainPID = true;
UMask = 007;
ExecStart = "${getBin pkgs.tmux}/bin/tmux -S ${cfg.dataDir}/terraria.sock new -d ${pkgs.terraria-server}/bin/TerrariaServer ${concatStringsSep " " flags}";
ExecStop = "${stopScript} $MAINPID";
};
postStart = ''
${pkgs.coreutils}/bin/chmod 660 ${cfg.dataDir}/terraria.sock
${pkgs.coreutils}/bin/chgrp terraria ${cfg.dataDir}/terraria.sock
'';
};
networking.firewall = mkIf cfg.openFirewall {