2026-03-12 14:41:33 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
2026-03-12 20:07:39 +00:00
|
|
|
OUT="${1:-"${REPO_ROOT}/infra/vm/weft-vm-result"}"
|
2026-03-12 14:41:33 +00:00
|
|
|
|
2026-03-12 20:07:39 +00:00
|
|
|
if [ -e "$OUT" ]; then
|
2026-03-12 14:41:33 +00:00
|
|
|
echo "error: $OUT already exists; remove it before rebuilding" >&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
cd "$REPO_ROOT"
|
|
|
|
|
|
2026-03-12 20:07:39 +00:00
|
|
|
echo "building NixOS VM..."
|
|
|
|
|
nix build .#nixosConfigurations.weft-vm.config.system.build.vm \
|
|
|
|
|
--out-link "$OUT" \
|
2026-03-12 14:41:33 +00:00
|
|
|
--print-build-logs
|
|
|
|
|
|
2026-03-12 20:07:39 +00:00
|
|
|
echo "VM script: $OUT/bin/run-weft-vm-vm"
|