Last active
July 22, 2020 02:52
-
-
Save HackerFoo/686a6292eb49d09efdb02ae71b006c07 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Download from a Nix cache to a tarball | |
# -------------------------------------- | |
# This script takes the part of the store path after /nix/store as the argument to specify what to download | |
# You can find this in the build details page on Hydra under "Output store paths". | |
# Requirements: nix, curl, xz (zxdec) | |
set -e | |
STORE_PATH=$1 | |
TMPDIR=$(mktemp -d) | |
CACHE=https://hydra.vtr.tools | |
curl ${CACHE}/nar/${STORE_PATH} | xzdec | nix-store --restore ${TMPDIR}/${STORE_PATH} | |
tar -C ${TMPDIR} -czf ${PWD}/${STORE_PATH}.tar.gz ${STORE_PATH} | |
rm -rf ${TMPDIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment