2021-04-02 14:18:50 +02:00
|
|
|
{ depot, config, lib, pkgs, ... }:
|
2020-07-31 23:30:52 +02:00
|
|
|
|
|
|
|
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;
|
2021-04-02 14:18:50 +02:00
|
|
|
script = "${depot.fun.paroxysm}/bin/paroxysm";
|
2020-08-01 04:36:55 +02:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2020-07-31 23:30:52 +02:00
|
|
|
|
|
|
|
environment = {
|
|
|
|
PARX_DATABASE_URL = "postgresql://tvldb:tvldb@localhost/tvldb";
|
|
|
|
PARX_IRC_CONFIG_PATH = "/var/lib/paroxysm/irc.toml";
|
|
|
|
};
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
DynamicUser = true;
|
|
|
|
StateDirectory = "paroxysm";
|
2020-11-05 00:13:35 +01:00
|
|
|
Restart = "always";
|
2020-07-31 23:30:52 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|