Last active
February 27, 2020 14:40
-
-
Save yorickvP/913b7f39a9b32a70ca554043dd825c05 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 | |
# 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