Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
execute nix-build remote
#!/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
You can’t perform that action at this time.