This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / 2configs / mumble-reminder.nix
3.2 kB 112 lines
1{ self, config, lib, pkgs, ... }: let 2 write_to_irc = chan: pkgs.writeDash "write_to_irc" '' 3 ${pkgs.curl}/bin/curl -fsSv --unix-socket '${lib.removePrefix "unix:" config.krebs.reaktor2.mumble-reminder.API.listen}' http://z/ \ 4 -H content-type:application/json \ 5 -d "$(${pkgs.jq}/bin/jq -n \ 6 --arg text "$1" '{ 7 command:"PRIVMSG", 8 params:["${chan}",$text] 9 }' 10 )" 11 ''; 12 animals = '' 13 Erdferkel 14 Paviane 15 Raupen 16 Australischen Wildhunde 17 Emus 18 Flundern 19 Gorillas 20 Kolibris 21 Schwarzfersenantilopen 22 Quallen 23 Kois 24 Faulaffen 25 Schraubenziegen 26 Nachtigallen 27 Okapis 28 Stachelschweine 29 Kurzschwanzkängurus 30 Waschbären 31 Kurzschwanzwiesel 32 Buschochsen 33 ''; 34 systemPlugin = { 35 plugin = "system"; 36 config = { 37 hooks.PRIVMSG = [ 38 { 39 pattern = "^erriner mich$"; 40 activate = "match"; 41 command = { 42 filename = pkgs.writeDash "add_remind" '' 43 echo "$_from" >> /var/lib/reaktor2-mumble-reminder/users 44 sort /var/lib/reaktor2-mumble-reminder/users | uniq > /var/lib/reaktor2-mumble-reminder/users.tmp 45 mv /var/lib/reaktor2-mumble-reminder/users.tmp /var/lib/reaktor2-mumble-reminder/users 46 echo "Ich werde $_from in zukunft an das meetup errinern" 47 ''; 48 }; 49 } 50 { 51 pattern = "^nerv nicht$"; 52 activate = "match"; 53 command = { 54 filename = pkgs.writeDash "del_remind" '' 55 ${pkgs.gnused}/bin/sed -i "/$_from/d" /var/lib/reaktor2-mumble-reminder/users 56 echo "okok, Ich werde $_from nich mehr errinern" 57 ''; 58 }; 59 } 60 ]; 61 }; 62 }; 63 64in { 65 imports = [ 66 self.inputs.stockholm.nixosModules.reaktor2 67 ]; 68 krebs.reaktor2.mumble-reminder = { 69 hostname = "irc.hackint.org"; 70 nick = "lassulus__"; 71 API.listen = "unix:/var/lib/reaktor2-mumble-reminder/reaktor_hackint.sock"; 72 plugins = [ 73 { 74 plugin = "register"; 75 config = { 76 channels = [ 77 "#krebs" 78 "#nixos" 79 ]; 80 }; 81 } 82 systemPlugin 83 ]; 84 port = "6697"; 85 }; 86 systemd.services.mumble-reminder-nixos = { 87 description = "weekly reminder for nixos mumble"; 88 startAt = "Wed *-*-* 19:00:00 Europe/Berlin"; 89 serviceConfig = { 90 ExecStart = pkgs.writers.writeDash "mumble_reminder" '' 91 animals=' 92 ${animals} 93 ' 94 ${write_to_irc "#nixos"} "Es ist Mittwoch meine $(echo "$animals" | grep -v '^$' | shuf -n1 )!" 95 ${write_to_irc "#nixos"} "kommt auf mumble://lassul.us" 96 ''; 97 }; 98 }; 99 systemd.services.mumble-reminder-krebs = { 100 description = "weekly reminder for nixos mumble"; 101 startAt = "Wed *-*-* 19:00:00 Europe/Berlin"; 102 serviceConfig = { 103 ExecStart = pkgs.writers.writeDash "mumble_reminder" '' 104 animals=' 105 ${animals} 106 ' 107 ${write_to_irc "#krebs"} "Es ist Mittwoch meine $(echo "$animals" | grep -v '^$' | shuf -n1 )!" 108 ${write_to_irc "#krebs"} "$(cat /var/lib/reaktor2-mumble-reminder/users | ${pkgs.findutils}/bin/xargs echo) : mumble?" 109 ''; 110 }; 111 }; 112}