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:
@@ -39,8 +39,20 @@
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [ self.packages.${system}.default ];
|
||||
packages = [ ];
|
||||
env = {
|
||||
# APP_VERSION and API_KEY are CMake cache variables with no
|
||||
# default; on a fresh configure cmake seeds their cache from
|
||||
# environment variables of the same name, so a plain
|
||||
# `cmake -S . -B build` bakes them into the binary.
|
||||
APP_VERSION = "dev";
|
||||
};
|
||||
shellHook = ''
|
||||
echo "RadiantWave dev shell"
|
||||
# Never commit the real key. Export API_KEY (or the CI name
|
||||
# RWT_LIVE_API_KEY) in your ambient environment and this shell
|
||||
# picks it up; empty by default (no auth header).
|
||||
export API_KEY="''${API_KEY:-''${RWT_LIVE_API_KEY:-}}"
|
||||
|
||||
echo "RadiantWave dev shell (APP_VERSION=dev, API_KEY=$([[ -n "$API_KEY" ]] && echo set || echo unset))"
|
||||
echo " Configure: cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug"
|
||||
echo " Build: cmake --build build"
|
||||
echo " Run: ./build/radiantwave"
|
||||
|
||||
Reference in New Issue
Block a user