Add build version indicator to sidebar menu

Display commit date and short hash (e.g., "2026-01-08 fb59ef7") below
the ANIMALTRACK title in the sidebar. In development, reads from git
directly; in Docker, reads from BUILD_DATE/BUILD_COMMIT env vars
injected at build time from the Nix flake.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-08 10:36:44 +00:00
parent fb59ef72a8
commit 5c12eb553c
4 changed files with 46 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
{ pkgs, pythonEnv, python }:
{ pkgs, pythonEnv, python, buildDate ? "unknown", buildCommit ? "unknown" }:
let
# Build animaltrack as a package
@@ -59,6 +59,8 @@ pkgs.dockerTools.buildImage {
"PATH=${pkgs.lib.makeBinPath [ pkgs.busybox pkgs.bash pkgs.sqlite pythonEnv animaltrack ]}"
"PYTHONPATH=${pythonEnv}/${pythonEnv.sitePackages}:${animaltrack}/${pythonEnv.sitePackages}"
"PYTHONUNBUFFERED=1"
"BUILD_DATE=${buildDate}"
"BUILD_COMMIT=${buildCommit}"
];
ExposedPorts = {
"5000/tcp" = {};