1
0
mirror of https://github.com/kmein/niveum synced 2026-03-22 12:51:08 +01:00

3 Commits

3 changed files with 9 additions and 5 deletions

View File

@@ -148,7 +148,12 @@ in {
yta = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -xic"; # Download with audio
};
}
{i18n.defaultLocale = "en_DK.UTF-8";}
{
i18n = {
defaultLocale = "en_DK.UTF-8";
supportedLocales = ["all"];
};
}
{
services.xserver = {
enable = true;

View File

@@ -10,7 +10,6 @@ in {
time = "08:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
chatIds = ["@HesychiosAlexandreus"];
parseMode = "Markdown";
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
};

View File

@@ -13,14 +13,14 @@ with lib; let
startAt = bot.time;
serviceConfig.Type = "oneshot";
wants = ["network-online.target"];
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then"]
script = strings.concatStringsSep "\n" (["QUOTE=$(${bot.command})" "if [ -n \"$QUOTE\" ]; then" "echo $QUOTE >&2"]
++ map (chatId: ''
${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \
-d chat_id="${chatId}" \
-d text="$QUOTE" ${
lib.strings.optionalString (bot.parseMode != null)
"-d parse_mode=${bot.parseMode}"
}
} | ${pkgs.jq}/bin/jq -e .ok
'')
bot.chatIds
++ ["fi"]);