From 49165590a6eb5cb2cb616977468e875e5c8cf885 Mon Sep 17 00:00:00 2001 From: DannyDannyDanny Date: Fri, 3 Apr 2026 12:15:51 +0200 Subject: [PATCH] feat: add fitness bot systemd service to sunken-ship Code deployed separately via rsync (private repo, not referenced here). Expects code at /home/danny/tg_fitness_bot/ and token at ~/.secrets/bigbiggerbiggestbot. Co-Authored-By: Claude Opus 4.6 (1M context) --- nixos/hosts/sunken-ship.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/nixos/hosts/sunken-ship.nix b/nixos/hosts/sunken-ship.nix index 4b90677..71385c6 100644 --- a/nixos/hosts/sunken-ship.nix +++ b/nixos/hosts/sunken-ship.nix @@ -95,6 +95,30 @@ in }; }; + # BigBiggerBiggestBot — Telegram fitness tracker with Mini App. + # Code deployed separately via rsync (private repo, not referenced here). + # Bot token: ~danny/.secrets/bigbiggerbiggestbot + systemd.services.fitness-bot = let + pythonEnv = pkgs.python3.withPackages (ps: with ps; [ + python-telegram-bot + python-dotenv + aiohttp + ]); + in { + description = "BigBiggerBiggestBot Telegram fitness tracker"; + after = [ "network-online.target" ]; + wants = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ pythonEnv pkgs.cloudflared ]; + serviceConfig = { + WorkingDirectory = "/home/danny/tg_fitness_bot"; + ExecStart = "${pythonEnv}/bin/python start.py"; + Restart = "on-failure"; + RestartSec = 10; + User = "danny"; + }; + }; + # Pull dotfiles and rebuild if the repo has new commits. systemd.services.dotfiles-rebuild = { description = "Pull dotfiles and run nixos-rebuild if repo changed";