#!/usr/bin/env bash if [[ ! -v NIX_BITCOIN_EXAMPLES_DIR ]]; then echo "Running script in nix shell env..." cd "${BASH_SOURCE[0]%/*}" exec nix-shell --run "./${BASH_SOURCE[0]##*/} $*" else cd "$NIX_BITCOIN_EXAMPLES_DIR" fi tmpDir=$(mktemp -d /tmp/nix-bitcoin-minimal-container.XXX) trap "rm -rf $tmpDir" EXIT # Modify importable-configuration.nix to use the local # source instead of fetchTarball ;|; s|system.extraDependencies = .*|| ' > $tmpDir/importable-configuration.nix cat > $tmpDir/configuration.nix <