e39b7e002c
Sometimes (like today) paroxysm crashes. We'd like it to restart if that happens. Change-Id: I98841096bcd6605c4279744ae5c65a9c92092a21 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2069 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
27 lines
698 B
Nix
27 lines
698 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.services.depot.paroxysm;
|
|
description = "TVL's majestic IRC bot";
|
|
in {
|
|
options.services.depot.paroxysm.enable = lib.mkEnableOption description;
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
systemd.services.paroxysm = {
|
|
inherit description;
|
|
script = "${config.depot.fun.paroxysm}/bin/paroxysm";
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
environment = {
|
|
PARX_DATABASE_URL = "postgresql://tvldb:tvldb@localhost/tvldb";
|
|
PARX_IRC_CONFIG_PATH = "/var/lib/paroxysm/irc.toml";
|
|
};
|
|
|
|
serviceConfig = {
|
|
DynamicUser = true;
|
|
StateDirectory = "paroxysm";
|
|
Restart = "always";
|
|
};
|
|
};
|
|
};
|
|
}
|