NixOS deployment template for Lamassu Bitcoin ATM server using nix-bitcoin and krops. Features: - Lamassu server with PostgreSQL and auto-generated secrets - TLS certificates (self-signed) - Test VM for local development - Template structure for easy customization
33 lines
766 B
Bash
Executable file
33 lines
766 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Deploy nix-bitcoin node
|
|
#
|
|
# Usage:
|
|
# ./deploy.sh # Build and deploy to target
|
|
# ./deploy.sh test # Test build only (no deploy)
|
|
# ./deploy.sh vm # Build and run test VM
|
|
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
case "${1:-deploy}" in
|
|
test)
|
|
echo "Testing build..."
|
|
nix-build krops.nix -A test --no-out-link
|
|
echo "Test build complete. Check /tmp/krops-test"
|
|
;;
|
|
vm)
|
|
echo "Building test VM..."
|
|
result=$(nix-build krops.nix -A vm --no-out-link)
|
|
echo "Starting VM..."
|
|
echo "Access admin UI at: https://localhost:8443"
|
|
"$result"/bin/run-*-vm
|
|
;;
|
|
deploy | *)
|
|
echo "Building deployment..."
|
|
result=$(nix-build krops.nix -A deploy --no-out-link)
|
|
echo "Deploying..."
|
|
"$result"
|
|
echo "Done!"
|
|
;;
|
|
esac
|