Files
nix-stuff/tliam
2025-02-08 19:50:17 -08:00

30 lines
662 B
Bash
Executable File

#!/usr/bin/env bash
set -e
function fail() {
msg="$1"
echo "FAIL: $msg" >&2
exit 1
}
git add .
declare -a flake_archive_cmd=(nix flake archive --json)
declare -a prefix
if [ "$HOST" != "triple-dezert" ]; then
flake_archive_cmd+=(--to "ssh://trip")
prefix+=(ssh trip -- sudo)
fi
flake_path="$("${flake_archive_cmd[@]}" | jq .path -r)"
# if "${prefix[@]}" nix build "${flake_path}#checks.x86_64-linux.liam-sieve"; then
# echo yay
# else
# fail "liam-sieve failed with exit code $?"
# fi
if "${prefix[@]}" nix run "${flake_path}#checks.x86_64-linux.liam.driver" -- "$@"; then
echo "SUCCESS" >&2
else
fail "liam-vm failed with exit code $?"
fi