#!/usr/bin/env bash set -euo pipefail source "$(dirname "$0")/common.sh" require_cmd curl tar ensure_dirs download "$KERNEL_URL" "$DOWNLOAD_DIR/$KERNEL_TARBALL" download "$NIX_URL" "$DOWNLOAD_DIR/$NIX_TARBALL" extract_tarball "$DOWNLOAD_DIR/$KERNEL_TARBALL" "$KERNEL_SRC_DIR" extract_tarball_into "$DOWNLOAD_DIR/$NIX_TARBALL" "$NIX_SRC_DIR" msg "sources are ready"