diff options
author | lassulus <lassulus@lassul.us> | 2022-11-28 00:20:34 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2022-11-28 00:20:34 +0100 |
commit | 85dd8bb9a558845d6e94d509b9aa164bb53c64c4 (patch) | |
tree | 964569d80747402637fb707e90b8de8d47931852 /krebs/2configs | |
parent | bc658b3eb553927cda9f4c8c99e4cdc716322f7a (diff) |
reaktor2: init say
Diffstat (limited to 'krebs/2configs')
-rw-r--r-- | krebs/2configs/reaktor2.nix | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index c452949b8..13b59fa82 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -98,6 +98,30 @@ let }; }; + say = { + pattern = "^!say (.*)$"; + activate = "match"; + arguments = [1]; + command = { + filename = pkgs.writeDash "say" '' + set -efu + + export PATH=${makeBinPath [ + pkgs.coreutils + pkgs.curl + pkgs.opusTools + ]} + paste_url=$(printf '%s' "$1" | + curl -fSsG http://tts.r/api/tts --data-urlencode 'text@-' | + opusenc - - | + curl -Ss https://p.krebsco.de --data-binary @- | + tail -1 + ) + echo "$_from: $paste_url" + ''; + }; + }; + taskRcFile = builtins.toFile "taskrc" '' confirmation=no ''; @@ -273,6 +297,7 @@ let bedger-add bedger-balance hooks.sed + say (generators.command_hook { inherit (commands) dance random-emoji nixos-version; tell = { |