1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/configs/telegram-bots/default.nix

82 lines
2.5 KiB
Nix
Raw Normal View History

2022-03-10 21:52:12 +01:00
{
config,
pkgs,
lib,
...
}: let
nixpkgs-21-11 = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-21.11.tar.gz") {
config.permittedInsecurePackages = [
"python3.9-poetry-1.1.12"
];
};
2022-06-08 09:52:08 +02:00
telebots = nixpkgs-21-11.callPackage <telebots> {};
reverseDirectory = "/run/telegram-reverse";
proverbDirectory = "/run/telegram-proverb";
inherit (import <niveum/lib>) tmpfilesConfig;
in {
imports = [
./literature-quote.nix
2021-12-25 08:30:28 +01:00
./astrology.nix
./autorenkalender.nix
./nachtischsatan.nix
./tlg-wotd.nix
<niveum/modules/telegram-bot.nix>
];
2022-03-10 21:52:12 +01:00
systemd.tmpfiles.rules = map (path:
tmpfilesConfig {
type = "d";
mode = "0750";
age = "1h";
inherit path;
}) [reverseDirectory proverbDirectory];
2022-05-22 11:47:59 +02:00
niveum.passport.services = [
{
title = "Rückwarts-Bot";
link = "https://t.me/RueckwaertsBot";
description = "reverses things on Telegram.";
}
{
title = "BetaCode-Bot";
link = "https://t.me/BetaCodeBot";
description = "converts <a href=\"https://en.wikipedia.org/wiki/Beta_Code\">beta code</a> to polytonic Greek on Telegram.";
}
{
title = "Sprichwortgenerator-Bot";
link = "https://t.me/SprichwortGeneratorBot";
description = "generates useless German proverbs with optional stock photo background on Telegram.";
}
];
systemd.services.telegram-reverse = {
2022-03-10 21:52:12 +01:00
wantedBy = ["multi-user.target"];
2021-06-12 14:21:09 +02:00
description = "Telegram reverse bot";
2022-03-10 21:52:12 +01:00
path = [pkgs.ffmpeg];
2021-06-12 14:21:09 +02:00
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/reverse.token>;
2022-06-08 09:52:08 +02:00
enable = true;
2021-06-12 14:21:09 +02:00
script = "${telebots}/bin/telegram-reverse";
serviceConfig.Restart = "always";
serviceConfig.WorkingDirectory = reverseDirectory;
};
systemd.services.telegram-betacode = {
2022-03-10 21:52:12 +01:00
wantedBy = ["multi-user.target"];
2021-06-12 14:21:09 +02:00
description = "Telegram beta code bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/betacode.token>;
2022-06-08 09:52:08 +02:00
enable = true;
2021-06-12 14:21:09 +02:00
script = "${telebots}/bin/telegram-betacode";
serviceConfig.Restart = "always";
};
systemd.services.telegram-proverb = {
2022-03-10 21:52:12 +01:00
wantedBy = ["multi-user.target"];
description = "Telegram proverb bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/proverb.token>;
2022-06-08 09:52:08 +02:00
enable = true;
script = "${telebots}/bin/telegram-proverb";
serviceConfig.Restart = "always";
serviceConfig.WorkingDirectory = proverbDirectory;
};
}