nixos/supybot: replace preStart with ExecStartPre

This commit is contained in:
h7x4
2025-10-15 22:48:56 +09:00
parent 589c370878
commit 257008a566

View File

@@ -104,14 +104,12 @@ in
documentation = [ "https://limnoria.readthedocs.io/" ];
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
preStart = ''
# This needs to be created afresh every time
rm -f '${cfg.stateDir}/supybot.cfg.bak'
'';
startLimitIntervalSec = 5 * 60; # 5 min
startLimitBurst = 1;
serviceConfig = {
# This needs to be created afresh every time
ExecStartPre = "${lib.getExe' pkgs.coreutils "rm"} -f '${cfg.stateDir}/supybot.cfg.bak'";
ExecStart = "${pyEnv}/bin/supybot ${cfg.stateDir}/supybot.cfg";
PIDFile = "/run/supybot.pid";
User = "supybot";