Skip to content

Instantly share code, notes, and snippets.

@yorickvP
Last active February 27, 2020 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorickvP/913b7f39a9b32a70ca554043dd825c05 to your computer and use it in GitHub Desktop.
Save yorickvP/913b7f39a9b32a70ca554043dd825c05 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# usage: ./nix-copy-quick.sh /nix/store/asdf.drv build-server.com
TMPDIR=$(mktemp -d)
echo $TMPDIR
function finish {
rm -rf $TMPDIR
}
trap finish EXIT
set -x
nix copy --to file://$TMPDIR $1
rsync -a $TMPDIR $2:
ssh $2 -t '
set -x
nix copy --from file://$(pwd)/'$(basename $TMPDIR)' '$1'
rm -r '$(basename $TMPDIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment