Something went wrong. Try again.
Monorepo for Tangled
Something went wrong. Try again.
823 B · 32 lines
Shell
at master
123456789101112131415161718192021222324252627282930313233#!/usr/bin/env bashset -euo pipefail
repo=$(cd "$(dirname "$0")/../.." && pwd)image_root="${1:-$repo/out/localinfra-spindle-images}"
mkdir -p "$image_root"
extract_image() { local package="$1" local name="$2" shift 2
local tarball tarball=$(nix build "$repo#$package" --no-link --print-out-paths)
[ -d "$image_root/$name" ] && chmod -R +w "$image_root/$name" || true rm -rf "$image_root/$name" mkdir -p "$image_root/$name" tar -C "$image_root/$name" -xzf "$tarball"
local alias for alias in "$@"; do rm -rf "$image_root/$alias" ln -s "$name" "$image_root/$alias" done}
extract_image spindle-nixos-image-tarball nixos-x86_64 nixosextract_image spindle-alpine-image-tarball alpine-x86_64 alpine
echo "prepared spindle microVM images in $image_root"