From f108abd7ae4d20c836836247faa071c41a699fbf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 01:42:45 +0000 Subject: [PATCH 1/2] Initial plan From 27f27b1503be074e42a485ba08cc2c1693e4cd4b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 7 Apr 2026 01:44:43 +0000 Subject: [PATCH 2/2] feat: add wallet-autoconnect module for Sparrow and Bisq 1 Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/29aa6dce-667a-49a6-9740-68d501fed22c Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- modules/core/sovran-hub.nix | 8 ++++ modules/modules.nix | 1 + modules/wallet-autoconnect.nix | 83 ++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 modules/wallet-autoconnect.nix diff --git a/modules/core/sovran-hub.nix b/modules/core/sovran-hub.nix index e0309c9..a903f0d 100644 --- a/modules/core/sovran-hub.nix +++ b/modules/core/sovran-hub.nix @@ -59,6 +59,14 @@ let { label = "Connection URL"; file = "/var/lib/secrets/zeus-connect-url"; qrcode = true; } { label = "How to Connect"; value = "1. Download Zeus from App Store or Google Play\n2. Open Zeus → Scan Node Config\n3. Scan the QR code above or paste the Connection URL"; } ]; } + { name = "Sparrow Auto-Connect"; unit = "sparrow-autoconnect.service"; type = "system"; icon = "sparrow"; enabled = cfg.services.bitcoin; category = "bitcoin-apps"; credentials = [ + { label = "Server"; value = "tcp://127.0.0.1:50001 (Electrs)"; } + { label = "Status"; value = "Auto-configured on first boot"; } + ]; } + { name = "Bisq Auto-Connect"; unit = "bisq-autoconnect.service"; type = "system"; icon = "bisq"; enabled = cfg.services.bitcoin; category = "bitcoin-apps"; credentials = [ + { label = "Node"; value = "127.0.0.1:8333 (Bitcoin Core)"; } + { label = "Status"; value = "Auto-configured on first boot"; } + ]; } { name = "Mempool"; unit = "mempool.service"; type = "system"; icon = "mempool"; enabled = cfg.features.mempool; category = "bitcoin-apps"; credentials = [ { label = "Tor Access"; file = "/var/lib/tor/onion/mempool-frontend/hostname"; prefix = "http://"; } { label = "Local Network"; file = "/var/lib/secrets/internal-ip"; prefix = "http://"; suffix = ":60847"; } diff --git a/modules/modules.nix b/modules/modules.nix index cf9e7de..a8eb10f 100755 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -24,6 +24,7 @@ ./nextcloud.nix ./vaultwarden.nix ./bitcoinecosystem.nix + ./wallet-autoconnect.nix # ── Features (default OFF — enable in custom.nix) ───────── ./haven.nix diff --git a/modules/wallet-autoconnect.nix b/modules/wallet-autoconnect.nix new file mode 100644 index 0000000..688e9c0 --- /dev/null +++ b/modules/wallet-autoconnect.nix @@ -0,0 +1,83 @@ +{ config, pkgs, lib, ... }: + +lib.mkIf config.sovran_systemsOS.services.bitcoin { + + # ── Sparrow Wallet Auto-Connect ───────────────────────────── + systemd.services.sparrow-autoconnect = { + description = "Auto-configure Sparrow Wallet to use local Electrs node"; + after = [ "electrs.service" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + path = [ pkgs.coreutils pkgs.iproute2 ]; + script = '' + CONFIG_FILE="/home/free/.sparrow/config" + + if [ -f "$CONFIG_FILE" ]; then + echo "Sparrow config already exists, skipping" + exit 0 + fi + + # Wait for Electrs to be ready (up to 30 attempts) + ATTEMPTS=0 + until ss -ltn 2>/dev/null | grep -q ':50001' || [ "$ATTEMPTS" -ge 30 ]; do + ATTEMPTS=$((ATTEMPTS + 1)) + sleep 2 + done + + mkdir -p /home/free/.sparrow + + cat > "$CONFIG_FILE" << 'EOF' +{ + "serverType": "ELECTRUM_SERVER", + "electrumServer": "tcp://127.0.0.1:50001", + "useProxy": false +} +EOF + + chown -R free:users /home/free/.sparrow + echo "Sparrow auto-configured to use local Electrs node" + ''; + }; + + # ── Bisq 1 Auto-Connect ───────────────────────────────────── + systemd.services.bisq-autoconnect = { + description = "Auto-configure Bisq to use local Bitcoin node"; + after = [ "bitcoind.service" ]; + wantedBy = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + path = [ pkgs.coreutils pkgs.iproute2 ]; + script = '' + BISQ_CONF="/home/free/.local/share/Bisq/bisq.properties" + + if [ -f "$BISQ_CONF" ]; then + echo "Bisq config already exists, skipping" + exit 0 + fi + + # Wait for bitcoind RPC to be ready (up to 30 attempts) + ATTEMPTS=0 + until ss -ltn 2>/dev/null | grep -q ':8333' || [ "$ATTEMPTS" -ge 30 ]; do + ATTEMPTS=$((ATTEMPTS + 1)) + sleep 2 + done + + mkdir -p /home/free/.local/share/Bisq + + cat > "$BISQ_CONF" << 'EOF' +btcNodes=127.0.0.1:8333 +useTorForBtc=true +useCustomBtcNodes=true +EOF + + chown -R free:users /home/free/.local/share/Bisq + echo "Bisq auto-configured to use local Bitcoin node" + ''; + }; + +}