stockholm/krebs/2configs/shack/reaktor.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

2021-09-05 19:27:30 +00:00
{ config, lib, pkgs, ... }:
{
krebs.reaktor2.shackie = {
hostname = "irc.libera.chat";
port = "6697";
nick = "shackie";
API.listen = "inet://127.0.0.1:7777";
plugins = [
{
plugin = "register";
config = {
channels = [
"#shackspace"
];
};
}
2022-10-28 14:21:19 +00:00
{
plugin = "system";
config = {
hooks.PRIVMSG = [
{
2022-10-28 14:49:57 +00:00
pattern = ''\.open\??$|\.offen\??$'';
2022-10-28 14:21:19 +00:00
activate = "match";
command.filename = pkgs.writers.writeDash "is_shack_open" ''
${pkgs.curl}/bin/curl -fSsk https://api.shackspace.de/v1/space |
${pkgs.jq}/bin/jq '.doorState.open'
'';
}
];
};
}
2021-09-05 19:27:30 +00:00
];
};
2021-09-05 19:52:47 +00:00
systemd.services.announce_doorstatus = {
startAt = "*:0/1";
path = with pkgs; [ curl jq ];
script = builtins.readFile ./doorstatus.sh;
serviceConfig = {
DynamicUser = true;
StateDirectory = "doorstatus";
WorkingDirectory = "/var/lib/doorstatus";
PrivateTmp = true;
};
};
2021-09-05 19:27:30 +00:00
}