WolframAlpha For drastikbot
This commit is contained in:
parent
49eb594429
commit
43e31a8d2d
@ -25,6 +25,10 @@ let
|
||||
cp -r ''${arr[1]}/* $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 \
|
||||
--prefix PYTHONPATH : ${with pkgs.python3Packages; makePythonPath [requests beautifulsoup4]} \
|
||||
--add-flags "$out/drastikbot.py"
|
||||
@ -54,6 +58,12 @@ in {
|
||||
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 {
|
||||
|
@ -122,7 +122,7 @@ in {
|
||||
});
|
||||
};
|
||||
|
||||
# wrap radio and drastikbot in a VPN
|
||||
# wrap radio in a VPN
|
||||
containers.vpn-continer = {
|
||||
ephemeral = true;
|
||||
autoStart = true;
|
||||
@ -175,7 +175,14 @@ in {
|
||||
# load the secret on behalf of the container
|
||||
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
|
||||
services.nginx.virtualHosts."radio.neet.space" = {
|
||||
|
@ -15,4 +15,5 @@ in
|
||||
"nextcloud-pw.age".publicKeys = all;
|
||||
"iodine.age".publicKeys = all;
|
||||
"spotifyd.age".publicKeys = all;
|
||||
"wolframalpha.age".publicKeys = all;
|
||||
}
|
BIN
secrets/wolframalpha.age
Normal file
BIN
secrets/wolframalpha.age
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user