tvl-depot/ops/nixos/paroxysm.nix
Griffin Smith e39b7e002c feat(ops/nixos/paroxysm): Set Restart = "always"
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>
2020-11-05 13:30:42 +00:00

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";
};
};
};
}