Compare commits
No commits in common. "c38e2216794885b11cb1261768509a29615dc411" and "d753a839ea1e40b6d65b0f9a8b544a9722cb7003" have entirely different histories.
c38e221679
...
d753a839ea
1 changed files with 2 additions and 11 deletions
13
module.nix
13
module.nix
|
|
@ -175,13 +175,6 @@ in
|
||||||
install -m 644 ${pkgs.trictrac}/GameConfig.json "$STATE_DIRECTORY/GameConfig.json"
|
install -m 644 ${pkgs.trictrac}/GameConfig.json "$STATE_DIRECTORY/GameConfig.json"
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
smtpEnvScript = if cfg.smtp.passwordFile != null then
|
|
||||||
pkgs.writeShellScript "trictrac-smtp-env" ''
|
|
||||||
set -euo pipefail
|
|
||||||
printf 'SMTP_PASS=%s\n' "$(< ${cfg.smtp.passwordFile})" > /run/trictrac/smtp.env
|
|
||||||
chmod 400 /run/trictrac/smtp.env
|
|
||||||
''
|
|
||||||
else null;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
description = "trictrac relay server";
|
description = "trictrac relay server";
|
||||||
|
|
@ -208,12 +201,10 @@ in
|
||||||
# systemd creates /var/lib/trictrac and sets STATE_DIRECTORY accordingly
|
# systemd creates /var/lib/trictrac and sets STATE_DIRECTORY accordingly
|
||||||
StateDirectory = "trictrac";
|
StateDirectory = "trictrac";
|
||||||
StateDirectoryMode = "0755";
|
StateDirectoryMode = "0755";
|
||||||
# systemd creates /run/trictrac for the smtp.env file
|
|
||||||
RuntimeDirectory = "trictrac";
|
|
||||||
WorkingDirectory = "/var/lib/trictrac";
|
WorkingDirectory = "/var/lib/trictrac";
|
||||||
ExecStartPre = [ "${setupScript}" ] ++ optional (smtpEnvScript != null) "+${smtpEnvScript}";
|
ExecStartPre = "${setupScript}";
|
||||||
ExecStart = "${pkgs.trictrac}/bin/relay-server";
|
ExecStart = "${pkgs.trictrac}/bin/relay-server";
|
||||||
EnvironmentFile = mkIf (cfg.smtp.passwordFile != null) "/run/trictrac/smtp.env";
|
EnvironmentFile = mkIf (cfg.smtp.passwordFile != null) cfg.smtp.passwordFile;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
RestartSec = "5s";
|
RestartSec = "5s";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue