feat(ops/nixos): Add module for running paroxysm on whitby

Change-Id: I415e3b046d4e0fcd7e800ddab0c7f1aeb639c5e2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1502
Tested-by: BuildkiteCI
Reviewed-by: eta <eta@theta.eu.org>
This commit is contained in:
Vincent Ambo 2020-07-31 22:30:52 +01:00 committed by tazjin
parent d671195c3b
commit f41324db8c
2 changed files with 29 additions and 0 deletions

25
ops/nixos/paroxysm.nix Normal file
View file

@ -0,0 +1,25 @@
{ 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";
environment = {
PARX_DATABASE_URL = "postgresql://tvldb:tvldb@localhost/tvldb";
PARX_IRC_CONFIG_PATH = "/var/lib/paroxysm/irc.toml";
};
serviceConfig = {
DynamicUser = true;
StateDirectory = "paroxysm";
};
};
};
}

View file

@ -19,6 +19,7 @@ in lib.fix(self: {
"${depot.depotPath}/ops/nixos/depot.nix"
"${depot.depotPath}/ops/nixos/monorepo-gerrit.nix"
"${depot.depotPath}/ops/nixos/panettone.nix"
"${depot.depotPath}/ops/nixos/paroxysm.nix"
"${depot.depotPath}/ops/nixos/smtprelay.nix"
"${depot.depotPath}/ops/nixos/sourcegraph.nix"
"${depot.depotPath}/ops/nixos/tvl-slapd/default.nix"
@ -223,6 +224,9 @@ in lib.fix(self: {
dbName = "panettone";
secretsFile = "/etc/secrets/panettone";
};
# Run the first cursed bot (quote bot)
paroxysm.enable = true;
};
services.postgresql = {