Created
October 13, 2020 09:14
-
-
Save matthiasbeyer/1208e86b25c5d32240f3e950aedd3ef4 to your computer and use it in GitHub Desktop.
execute nix-build remote
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 | |
host="$1" | |
branch="$2" | |
pkg="$3" | |
remote_dir="$$" | |
[[ -z "$host" ]] && { echo "no HOST"; exit 1; } | |
[[ -z "$branch" ]] && { echo "no branch"; exit 1; } | |
[[ -z "$pkg" ]] && { echo "no pkg"; exit 1; } | |
ssh "$host" -- "mkdir /tmp/$remote_dir" | |
git archive --format=tgz "$branch" | ssh "$host" "tar -C /tmp/$remote_dir -xvzf -" | |
ssh "$host" -- "cd /tmp/$remote_dir && nix-build -A $pkg" | |
echo ready | |
echo "See: /tmp/$remote_dir" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment