Files
KioskConfig/build-rpi.sh
T
NeilClack d54637d249 Bake the channel manifest's closure instead of a pinned app version
Production builds failed CI's baseline preflight because flake.nix pinned
the app to tag 1.8 (channel.appVersion = "1.8") while the published
manifest had moved on to 1.9.

Stop pinning the app anywhere. flake.nix now fetches the channel's
published manifest at eval time (builtins.fetchurl) and bakes its
storePath verbatim, so every image carries exactly the closure RadiantWave
published to Attic and never compiles the app from source.

- flake.nix: drop the radiantwave/radiantwave-dev inputs, appInput,
  appVersion, channelVersion and baselineOutPaths; add channelAtticUrl,
  channelManifestDir and publishedApp; builders consume the published path.
- configuration.nix: wrap the published store path in a symlinkJoin so it
  can live in environment.systemPackages; add --impure to autoUpgrade
  flags and set tarball-ttl = 0 so eval reads the current manifest.
- radiantwave-updater.nix: baselinePackage (package) -> baselinePath (str),
  seeded from the exact manifest path.
- CI (build.yml): replace the version-equality preflight with a fail-fast
  check that the announced closure is in the channel's Attic; set
  tarball-ttl = 0.
- build-rpi.sh: pass --impure.
- AGENTS.md: document the manifest-driven baseline.
2026-10-07 10:28:12 -05:00

46 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CONFIG="radiantwavekiosk-rpi"
TIMESTAMP=$(date +"%Y-%m-%d_%H-%M-%S")
FILENAME="radiantwave-raspberrypi-${TIMESTAMP}.img.zst"
REPO="$(pwd)"
NIX_STORE="kiosk-nix-store"
NIX_STATE="kiosk-nix-state"
echo "==> Building ${CONFIG}..."
echo "==> Output: ${REPO}/${FILENAME}"
echo ""
podman volume create "${NIX_STORE}" 2>/dev/null || true
podman volume create "${NIX_STATE}" 2>/dev/null || true
podman run --rm \
-v "${REPO}:/repo" \
-v "${NIX_STORE}:/nix/store" \
-v "${NIX_STATE}:/nix/var/nix" \
-w /repo \
nixos/nix:latest \
sh -c '
set -ex
mkdir -p /etc/nix
echo "experimental-features = nix-command flakes" > /etc/nix/nix.conf
echo "accept-flake-config = true" >> /etc/nix/nix.conf
echo "tarball-ttl = 0" >> /etc/nix/nix.conf
echo "extra-substituters = https://cache.nixos.org https://nixos-raspberrypi.cachix.org https://attic.radiantwavetech.com/radiantwave https://attic.radiantwavetech.com/radiantwave-dev" >> /etc/nix/nix.conf
echo "extra-trusted-public-keys = nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI= radiantwave:QADrjpBWJssTZ3KmiZtcWEf4uAm66oOlHmtQI3jkrgA= radiantwave-dev:B8FhLu3MQ9JfeEIHIKNrKxnP+3akzzkqMbTZR4hRfj0=" >> /etc/nix/nix.conf
echo "max-jobs = 4" >> /etc/nix/nix.conf
echo "==> Building sdImage (first run slow, cached after)..."
nix --accept-flake-config build \
.#nixosConfigurations.'${CONFIG}'.config.system.build.sdImage \
--impure \
--fallback \
--print-build-logs
echo "==> Build complete, copying..."
cp result/sd-image/*.img.zst /repo/'${FILENAME}'
echo "==> Done: ${FILENAME}"
ls -lh /repo/'${FILENAME}'
'