1
0
mirror of https://github.com/kmein/niveum synced 2026-03-30 01:01:10 +02: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 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 = { services.xserver = {
enable = true; enable = true;

View File

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

View File

@@ -13,14 +13,14 @@ with lib; let
startAt = bot.time; startAt = bot.time;
serviceConfig.Type = "oneshot"; serviceConfig.Type = "oneshot";
wants = ["network-online.target"]; 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: '' ++ 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 chat_id="${chatId}" \
-d text="$QUOTE" ${ -d text="$QUOTE" ${
lib.strings.optionalString (bot.parseMode != null) lib.strings.optionalString (bot.parseMode != null)
"-d parse_mode=${bot.parseMode}" "-d parse_mode=${bot.parseMode}"
} } | ${pkgs.jq}/bin/jq -e .ok
'') '')
bot.chatIds bot.chatIds
++ ["fi"]); ++ ["fi"]);