2022-05-19 14:39:52 +00:00
|
|
|
{ depot, config, lib, pkgs, ... }:
|
2020-09-30 03:42:59 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.depot.paroxysm;
|
|
|
|
description = "TVL's majestic IRC bot";
|
2022-05-19 14:39:52 +00:00
|
|
|
in
|
|
|
|
{
|
2020-09-30 03:42:59 +00:00
|
|
|
options.services.depot.paroxysm.enable = lib.mkEnableOption description;
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
systemd.services.paroxysm = {
|
|
|
|
inherit description;
|
2022-05-19 14:39:52 +00:00
|
|
|
script = "${depot.fun.paroxysm}/bin/paroxysm";
|
2020-09-30 03:42:59 +00:00
|
|
|
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";
|
2022-05-19 14:39:52 +00:00
|
|
|
Restart = "always";
|
2020-09-30 03:42:59 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|