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