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 110 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 ''; 32 systemPlugin = { 33 plugin = "system"; 34 config = { 35 hooks.PRIVMSG = [ 36 { 37 pattern = "^erriner mich$"; 38 activate = "match"; 39 command = { 40 filename = pkgs.writeDash "add_remind" '' 41 echo "$_from" >> /var/lib/reaktor2-mumble-reminder/users 42 sort /var/lib/reaktor2-mumble-reminder/users | uniq > /var/lib/reaktor2-mumble-reminder/users.tmp 43 mv /var/lib/reaktor2-mumble-reminder/users.tmp /var/lib/reaktor2-mumble-reminder/users 44 echo "Ich werde $_from in zukunft an das meetup errinern" 45 ''; 46 }; 47 } 48 { 49 pattern = "^nerv nicht$"; 50 activate = "match"; 51 command = { 52 filename = pkgs.writeDash "del_remind" '' 53 ${pkgs.gnused}/bin/sed -i "/$_from/d" /var/lib/reaktor2-mumble-reminder/users 54 echo "okok, Ich werde $_from nich mehr errinern" 55 ''; 56 }; 57 } 58 ]; 59 }; 60 }; 61 62in { 63 imports = [ 64 self.inputs.stockholm.nixosModules.reaktor2 65 ]; 66 krebs.reaktor2.mumble-reminder = { 67 hostname = "irc.hackint.org"; 68 nick = "lassulus__"; 69 API.listen = "unix:/var/lib/reaktor2-mumble-reminder/reaktor_hackint.sock"; 70 plugins = [ 71 { 72 plugin = "register"; 73 config = { 74 channels = [ 75 "#krebs" 76 "#nixos" 77 ]; 78 }; 79 } 80 systemPlugin 81 ]; 82 port = "6697"; 83 }; 84 systemd.services.mumble-reminder-nixos = { 85 description = "weekly reminder for nixos mumble"; 86 startAt = "Wed *-*-* 19:00:00 Europe/Berlin"; 87 serviceConfig = { 88 ExecStart = pkgs.writers.writeDash "mumble_reminder" '' 89 animals=' 90 ${animals} 91 ' 92 ${write_to_irc "#nixos"} "Es ist Mittwoch meine $(echo "$animals" | grep -v '^$' | shuf -n1 )!" 93 ${write_to_irc "#nixos"} "kommt auf mumble://lassul.us" 94 ''; 95 }; 96 }; 97 systemd.services.mumble-reminder-krebs = { 98 description = "weekly reminder for nixos mumble"; 99 startAt = "Wed *-*-* 19:00:00 Europe/Berlin"; 100 serviceConfig = { 101 ExecStart = pkgs.writers.writeDash "mumble_reminder" '' 102 animals=' 103 ${animals} 104 ' 105 ${write_to_irc "#krebs"} "Es ist Mittwoch meine $(echo "$animals" | grep -v '^$' | shuf -n1 )!" 106 ${write_to_irc "#krebs"} "$(cat /var/lib/reaktor2-mumble-reminder/users | ${pkgs.findutils}/bin/xargs echo) : mumble?" 107 ''; 108 }; 109 }; 110}