From b6f6aee6babee6876a51973d619b867d3145ed25 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 28 Oct 2022 16:21:19 +0200 Subject: shackie: add .open command --- krebs/2configs/shack/reaktor.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'krebs') diff --git a/krebs/2configs/shack/reaktor.nix b/krebs/2configs/shack/reaktor.nix index a31c7a687..76e66f692 100644 --- a/krebs/2configs/shack/reaktor.nix +++ b/krebs/2configs/shack/reaktor.nix @@ -14,6 +14,21 @@ ]; }; } + { + plugin = "system"; + config = { + hooks.PRIVMSG = [ + { + pattern = ".open$"; + 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 = { -- cgit v1.2.3