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) <noreply@anthropic.com>
This commit is contained in:
parent
cfa2834516
commit
49165590a6
1 changed files with 24 additions and 0 deletions
|
|
@ -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.
|
# Pull dotfiles and rebuild if the repo has new commits.
|
||||||
systemd.services.dotfiles-rebuild = {
|
systemd.services.dotfiles-rebuild = {
|
||||||
description = "Pull dotfiles and run nixos-rebuild if repo changed";
|
description = "Pull dotfiles and run nixos-rebuild if repo changed";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue