blob: 1f723c8e65fb9ee9bdb404a758c9b5f612b4f61e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
{ 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"
];
};
}
{
plugin = "system";
config = {
hooks.PRIVMSG = [
{
pattern = ''\.open\??$|\.offen\??$'';
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'
'';
}
];
};
}
];
};
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;
};
};
}
|