1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat(telegram bots): update

This commit is contained in:
2021-06-12 14:21:09 +02:00
parent 6cdfdaf703
commit daef8b79d4

View File

@@ -4,20 +4,10 @@ let
telebots-package = pkgs.fetchFromGitHub {
owner = "kmein";
repo = "telebots";
rev = "b4276155114ee96cd3f320e361e52952ea700db6";
sha256 = "08rp1pcisk4zzhxdlgrlhxa0sbza5qhxa70rjycg4r7fmixkkbz2";
rev = "ce613f5b298721c6eaa7af25a666bd65388a0daf";
sha256 = "0bl02976kxjbbbmvcnjjgpmxrmpwplw9qcldxk5h3wngzixxizhg";
};
in {
reverse =
pkgs.python3Packages.callPackage "${telebots-package}/telegram-reverse"
{ };
odyssey =
pkgs.python3Packages.callPackage "${telebots-package}/telegram-odyssey"
{ };
betacode =
pkgs.python3Packages.callPackage "${telebots-package}/telegram-betacode"
{ };
};
in pkgs.callPackage telebots-package {};
in {
imports = [
./literature-quote.nix
@@ -28,34 +18,22 @@ in {
<niveum/modules/telegram-bot.nix>
];
systemd.services.telegram-odyssey = {
wantedBy = [ "multi-user.target" ];
description = "Telegram bot reciting the Odyssey to you";
environment.TELEGRAM_ODYSSEY_TOKEN =
lib.strings.fileContents <system-secrets/telegram/odyssey.token>;
enable = true;
script = "${telebots.odyssey}/bin/telegram-odyssey";
serviceConfig.Restart = "always";
};
systemd.services.telegram-reverse = {
wantedBy = [ "multi-user.target" ];
description = "Telegram bot for reversing things";
environment.TELEGRAM_REVERSE_TOKEN =
lib.strings.fileContents <system-secrets/telegram/reverse.token>;
description = "Telegram reverse bot";
path = [ pkgs.ffmpeg ];
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/reverse.token>;
enable = true;
script = "${telebots.reverse}/bin/telegram-reverse";
script = "${telebots}/bin/telegram-reverse";
serviceConfig.Restart = "always";
};
systemd.services.telegram-betacode = {
wantedBy = [ "multi-user.target" ];
description =
"Telegram bot for converting Ancient Greek betacode into unicode";
environment.TELEGRAM_BETACODE_TOKEN =
lib.strings.fileContents <system-secrets/telegram/betacode.token>;
description = "Telegram beta code bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/betacode.token>;
enable = true;
script = "${telebots.betacode}/bin/telegram-betacode";
script = "${telebots}/bin/telegram-betacode";
serviceConfig.Restart = "always";
};
}