WolframAlpha For drastikbot

This commit is contained in:
Zuckerberg 2022-03-27 19:23:07 -04:00
parent 49eb594429
commit 43e31a8d2d
4 changed files with 20 additions and 2 deletions

View File

@ -25,6 +25,10 @@ let
cp -r ''${arr[1]}/* $out/irc/modules cp -r ''${arr[1]}/* $out/irc/modules
cp -r ''${arr[2]}/* $out/irc/modules cp -r ''${arr[2]}/* $out/irc/modules
sed -i 's|\(http://drastik.org/drastikbot"\)|\1 " https://git.neet.dev/zuckerberg/dailybuild_modules"|' $out/irc/modules/information.py
sed -i 's|\(https://github.com/olagood/drastikbot_modules\\x0F"\)|\1 " : \\x0311https://git.neet.dev/zuckerberg/dailybuild_modules\\x0F"|' $out/irc/modules/information.py
sed -i 's|AppID = "Enter your AppID here"|import pathlib\nAppID = pathlib.Path("${cfg.wolframAppIdFile}").read_text()|' $out/irc/modules/wolframalpha.py
makeWrapper ${pkgs.python3}/bin/python3 $out/drastikbot \ makeWrapper ${pkgs.python3}/bin/python3 $out/drastikbot \
--prefix PYTHONPATH : ${with pkgs.python3Packages; makePythonPath [requests beautifulsoup4]} \ --prefix PYTHONPATH : ${with pkgs.python3Packages; makePythonPath [requests beautifulsoup4]} \
--add-flags "$out/drastikbot.py" --add-flags "$out/drastikbot.py"
@ -54,6 +58,12 @@ in {
Path to the drastikbot data directory Path to the drastikbot data directory
''; '';
}; };
wolframAppIdFile = lib.mkOption {
type = lib.types.str;
description = ''
The file containing the Wolfram Alpha App ID
'';
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -122,7 +122,7 @@ in {
}); });
}; };
# wrap radio and drastikbot in a VPN # wrap radio in a VPN
containers.vpn-continer = { containers.vpn-continer = {
ephemeral = true; ephemeral = true;
autoStart = true; autoStart = true;
@ -175,7 +175,14 @@ in {
# load the secret on behalf of the container # load the secret on behalf of the container
age.secrets."pia-login.conf".file = ../../secrets/pia-login.conf; age.secrets."pia-login.conf".file = ../../secrets/pia-login.conf;
services.drastikbot.enable = true; services.drastikbot = {
enable = true;
wolframAppIdFile = "/run/agenix/wolframalpha";
};
age.secrets.wolframalpha = {
file = ../../secrets/wolframalpha.age;
owner = config.services.drastikbot.user;
};
# icecast endpoint + website # icecast endpoint + website
services.nginx.virtualHosts."radio.neet.space" = { services.nginx.virtualHosts."radio.neet.space" = {

View File

@ -15,4 +15,5 @@ in
"nextcloud-pw.age".publicKeys = all; "nextcloud-pw.age".publicKeys = all;
"iodine.age".publicKeys = all; "iodine.age".publicKeys = all;
"spotifyd.age".publicKeys = all; "spotifyd.age".publicKeys = all;
"wolframalpha.age".publicKeys = all;
} }

BIN
secrets/wolframalpha.age Normal file

Binary file not shown.