Files
KioskConfig/build-rpi.sh
T
NeilClack 5a6031a3fe refactor: migrate from Codeberg to Gitea and rename rhemawave to radiantwave
- Update all Codeberg URLs to gitea.radiantwavetech.com/RadiantWaveTech/
- Rename flake inputs: rhemawave → radiantwave, rhemawave-dev → radiantwave-dev
- Rename NixOS configs: rhemawavekiosk* → radiantwavekiosk*
- Update systemd services, data paths, and binary references
- Rename plymouth theme files
- Update CI workflow, documentation, and build scripts
2026-07-27 14:23:31 -05:00

50 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
CONFIG="radiantwavekiosk-rpi"
VARIANT=""
for arg in "$@"; do
case "$arg" in
--dev) CONFIG="radiantwavekiosk-rpi-dev"; VARIANT="-dev" ;;
*) echo "Unknown arg: $arg"; exit 1 ;;
esac
done
TIMESTAMP=$(date +"%m%d%Y-%H%M")
FILENAME="radiantwave-kiosk-rpi${VARIANT}_${TIMESTAMP}.img.zst"
REPO="$(pwd)"
NIX_STORE="kiosk-nix-store"
echo "==> Building ${CONFIG}..."
echo "==> Output: ${REPO}/${FILENAME}"
echo ""
podman volume create "${NIX_STORE}" 2>/dev/null || true
podman run --rm \
-v "${REPO}:/repo" \
-v "${NIX_STORE}:/nix/store" \
-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 "extra-substituters = https://cache.nixos.org https://nixos-raspberrypi.cachix.org" >> /etc/nix/nix.conf
echo "extra-trusted-public-keys = nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI=" >> /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 \
--fallback \
--print-build-logs
echo "==> Build complete, copying..."
cp result/sd-image/*.img* /repo/'${FILENAME}'
echo "==> Done: ${FILENAME}"
ls -lh /repo/'${FILENAME}'
'