build: seed APP_VERSION and API_KEY from the environment

Fresh cmake configures pick up APP_VERSION/API_KEY from environment
variables (as nix develop and CI provide them); -D still wins on
reconfigure. Also normalizes indentation in the sd-bus blocks.
This commit is contained in:
NeilClack
2026-08-12 12:00:39 -05:00
parent 442565508e
commit 44927ebb98
3 changed files with 41 additions and 11 deletions
+5 -1
View File
@@ -30,7 +30,11 @@ the project version, or pass your own at configure time:
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DAPP_VERSION="1.2.3"
```
The Nix package passes its flake version automatically via `cmakeFlags`.
The Nix package bakes `-DAPP_VERSION=<pkg version>` via `cmakeFlags` (version is
hardcoded `0.1.0` in `nix/package.nix`, not read from the flake). `nix develop`
sets `APP_VERSION=dev` and exports `API_KEY` from the ambient environment
(falling back to `RWT_LIVE_API_KEY`). CMake seeds a *fresh* configure from the
`APP_VERSION` / `API_KEY` env vars; `-D` wins on reconfigure.
The portal API key is also a build-time argument: `-DAPI_KEY="..."` (CMake) or
`apiKey` on `callPackage` (Nix). It is compiled into the binary as the