Skip to content

Commit

Permalink
Merge pull request #128 from serokell/sereja/OPS-1402-add-restart-policy
Browse files Browse the repository at this point in the history
[Chore] Add systemd unit restart policy
  • Loading branch information
Sereja313 authored Jan 17, 2024
2 parents 3119cde + c23b821 commit e949663
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: MPL-2.0
{ self, ... }@inputs: { config, pkgs, lib, ... }:
let
inherit (lib) mkEnableOption mkOption types mkIf;
inherit (lib) mkEnableOption mkOption types mkIf mkDefault;
in
{
options.services.tzbot = {
Expand Down Expand Up @@ -50,10 +50,14 @@ in
export SLACK_TZ_BOT_TOKEN="${cfg.slackBotToken}"
${cfg.package}/bin/tzbot-exe --config ${pkgs.writeText "config.yml" (builtins.toJSON cfg.botConfig)}
'';
startLimitBurst = mkDefault 5;
startLimitIntervalSec = mkDefault 300;
serviceConfig = {
User = "tzbot";
Group = "tzbot";
StateDirectory = "tzbot";
Restart = mkDefault "on-failure";
RestartSec = mkDefault 10;
};
};
users.users.tzbot = {
Expand Down

0 comments on commit e949663

Please sign in to comment.