Python bot that parses workout messages (Exercise: SetsxRepsxWeight), detects supersets from consecutive lines, extracts machine IDs, stores both raw message text and parsed data in SQLite, and reads original timestamps from forwarded Saved Messages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{
|
|
description = "BigBiggerBiggestBot — Telegram fitness tracker";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
python = pkgs.python3;
|
|
|
|
pythonEnv = python.withPackages (ps: with ps; [
|
|
python-telegram-bot
|
|
python-dotenv
|
|
]);
|
|
in
|
|
{
|
|
# `nix develop` — drop into a shell with everything available
|
|
devShells.default = pkgs.mkShell {
|
|
packages = [ pythonEnv ];
|
|
shellHook = ''
|
|
echo "💪 BigBiggerBiggestBot dev shell"
|
|
echo " Run: python bot.py"
|
|
'';
|
|
};
|
|
|
|
# `nix run` — start the bot from the current directory
|
|
apps.default = {
|
|
type = "app";
|
|
program = toString (pkgs.writeShellScript "run-bot" ''
|
|
exec ${pythonEnv}/bin/python "$PWD/bot.py"
|
|
'');
|
|
};
|
|
}
|
|
);
|
|
}
|