diff --git a/common/server/drastikbot.nix b/common/server/drastikbot.nix index 2952a02..ed585a6 100644 --- a/common/server/drastikbot.nix +++ b/common/server/drastikbot.nix @@ -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 { diff --git a/machines/liza/configuration.nix b/machines/liza/configuration.nix index 325dcfd..7e9c9d0 100644 --- a/machines/liza/configuration.nix +++ b/machines/liza/configuration.nix @@ -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" = { diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 6d2bb60..5caeab8 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -15,4 +15,5 @@ in "nextcloud-pw.age".publicKeys = all; "iodine.age".publicKeys = all; "spotifyd.age".publicKeys = all; + "wolframalpha.age".publicKeys = all; } \ No newline at end of file diff --git a/secrets/wolframalpha.age b/secrets/wolframalpha.age new file mode 100644 index 0000000..b032c2a Binary files /dev/null and b/secrets/wolframalpha.age differ