Files
JakeHillion ecda279771
commit-validation / validate-single-commit (pull_request) Successful in 4s
flake / flake (push) Successful in 6m55s
nix-builder (aarch64-linux) Build completed successfully
awtrix-fireworks-tokens: show 7-day kimi-k2p5 usage on ulanzi clock
The Ulanzi TC001 (AWTRIX 3) had no presence in the repo and no
visibility into how much we're spending on Fireworks for kimi-k2p5.

Pinned the clock to 10.239.19.13 on the IoT VLAN via the existing
topology module, packaged the prebuilt firectl binary (not the
firecracker tool of the same name in nixpkgs) and added a new
awtrix-fireworks-tokens service. A 30-minute oneshot timer on stinger
runs firectl billing export-metrics for the rolling 7-day window, sums
prompt + completion tokens for rows whose base_model_name contains
kimi-k2p5, and POSTs a custom app payload to the clock with a 9x8
fireworks logo and the count formatted as N / N.NK / NK / N.NM. A zero
total POSTs an empty body to remove the slot, and a 90-minute lifetime
acts as a failsafe if the service itself stops running.

Service runs as DynamicUser with a RuntimeDirectory for the CSV and the
Fireworks API key delivered via LoadCredential from an agenix-rekey
secret. Always POSTing under the same custom-app name keeps the screen
to exactly one rotation slot.

Test plan:
- CI
- nix build '.#nixosConfigurations."stinger.pop.neb.jakehillion.me".config.system.build.toplevel'
- After deploy: systemctl start awtrix-fireworks-tokens.service and verify the slot appears on the clock
2026-04-09 18:40:21 +01:00
..