#!/usr/bin/env bash function hash { archive="$(mktemp /tmp/nix-config.XXX.tar.gz)" git archive "$1" | gzip > "$archive" nix-prefetch-url --unpack --type sha256 "file:$archive" 2>/dev/null rm "$archive" } if [ -z "$1" ] then echo "usage: deploy " exit 1 fi host="${1}" rev="$(git rev-parse HEAD)" sha256=$(hash "$rev") cat <