bitspire/devenv.nix
Padreug 763817b9f3 chore(dev): remove the Lightning.Pub-era regtest tooling
docker/ (two compose stacks, dev.sh, regtest.sh, start-with-regtest.sh,
regtest-bootstrap.sh, strfry.conf), packages/nostr-client/dev/ (nine
agent and test scripts), and the seventeen devenv commands that drove
them — infra-*, lncli, btccli, mine-blocks, auto-mine, setup-channel,
alice-*, fund-atm, test-setup, test-payment, node-info — along with the
devenv postgres service, DATABASE_URL, LIGHTNING_PUB_URL, pgcli,
docker-compose and the `just` runner (no justfile exists).

None of it could talk to the app on `dev`. Every piece was built around
Lightning.Pub (a `lightning-pub` service in both compose files, 37
references in dev.sh, LIGHTNING_PUB_PUBKEY and the :1776 API in every
dev script, a NIP-44 v1 implementation the project forbids), and the
last substantive change predates the LNbits cutover that deleted
packages/lightning. No container under either name exists on any
machine. Development runs against LNbits: FakeWallet needs nothing,
bohm's native instance answers on :5001, and the shared regtest stack
lives at ~/dev/local/docker/regtest, outside this repo.

devenv.nix keeps the toolchain, the hardware/serial utilities, the git
hooks and `relay-test`, now pointed at LNbits's bundled nostrrelay. The
Rust toolchain stays for the orphaned crate until that is removed on its
own. nostr-client drops the four dependencies and two devDependencies
only the dead scripts imported (@noble/curves, @scure/base,
@shocknet/clink-sdk, @stablelib/xchacha20, qrcode, ws); lockfile
regenerated, −272 lines.

Verified: devenv.nix parses; nostr-client 43/43 + tsc; clink 11/11 + tsc;
machine app vue-tsc clean. The ndebit-cash-in-flow doc, kept as CLINK
design history, now says the commands it quotes no longer exist here.
2026-10-09 22:25:07 +02:00

129 lines
3.6 KiB
Nix

{ pkgs, lib, config, ... }:
{
name = "bitspire";
# ============================================
# Languages
# ============================================
languages.javascript = {
enable = true;
package = pkgs.nodejs_22;
pnpm = {
enable = true;
install.enable = true;
};
};
languages.typescript.enable = true;
packages = with pkgs; [
# Rust toolchain — only the orphaned Rust HAL under packages/hal/src
# uses it (not built; see CLAUDE.md → Hardware drivers). Kept so the
# rustfmt git hook and `cargo check` still work until that crate is
# removed outright.
rustc
cargo
clippy
rustfmt
rust-analyzer
# Build tools
pkg-config
openssl
openssl.dev
# Python for node-gyp (native module builds: serialport, better-sqlite3)
(python3.withPackages (ps: [ ps.setuptools ]))
# Hardware access
libusb1
udev
# Serial port access (talk to a validator / dispenser by hand)
picocom
# Development utilities
jq # JSON processing
websocat # WebSocket client — relay-test below
qrencode # QR code generation for terminal
];
# ============================================
# Git Hooks (formerly pre-commit)
# ============================================
git-hooks.hooks = {
# TypeScript/JavaScript
prettier = {
enable = true;
excludes = [ "pnpm-lock.yaml" ];
};
# Rust
rustfmt.enable = true;
# Nix formatting
nixpkgs-fmt.enable = true;
# TOML/YAML validation
check-toml.enable = true;
check-yaml.enable = true;
};
# ============================================
# Environment Variables
# ============================================
env = {
RUST_BACKTRACE = "1";
# The dev relay is LNbits's bundled nostrrelay extension on the native
# instance (see CLAUDE.md → Environment variables); there is no
# in-repo relay container any more. Override per shell as needed.
NOSTR_RELAY_URL = "ws://localhost:5001/nostrrelay/test";
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
};
# ============================================
# Scripts (available as commands in shell)
# ============================================
#
# The Lightning.Pub-era regtest stack (docker/ + the infra-*/lncli/btccli/
# mine-blocks/setup-channel/fund-atm/test-* commands that drove it) was
# removed 2026-10-09. Development runs against LNbits: FakeWallet needs
# nothing; bohm's native instance answers on :5001; the shared regtest
# stack lives at ~/dev/local/docker/regtest (not in this repo).
scripts = {
dev.exec = "pnpm turbo dev";
build.exec = "pnpm turbo build";
test.exec = "pnpm turbo test";
lint.exec = "pnpm turbo lint";
# Test the dev relay connection
relay-test.exec = ''
echo "Testing Nostr relay connection to $NOSTR_RELAY_URL ..."
echo '["REQ", "test", {"kinds": [0], "limit": 1}]' | websocat "$NOSTR_RELAY_URL"
'';
};
enterShell = ''
echo ""
echo " ⚡ bitSpire - Nostr-Native Lightning ATM"
echo " ─────────────────────────────────────────────"
echo " Node.js: $(node --version)"
echo " Rust: $(rustc --version | cut -d' ' -f2)"
echo " pnpm: $(pnpm --version)"
echo ""
echo " Development:"
echo " dev Start development servers"
echo " build Build all packages"
echo " test Run tests"
echo " lint Lint all packages"
echo " relay-test Test the dev relay ($NOSTR_RELAY_URL)"
echo ""
'';
}