From 83665bf4de4b089d949f0e9f0c11c1085dcd59ed Mon Sep 17 00:00:00 2001 From: r4bbit <445106+0x-r4bbit@users.noreply.github.com> Date: Wed, 29 Apr 2026 13:44:30 +0200 Subject: [PATCH] chore(amm): add Logos Basecamp support Provides the necessary instructions to run the AMM app inside Logos Basecamp. Closes #29 --- amm-ui/.gitignore | 3 ++ amm-ui/README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++-- amm-ui/flake.nix | 2 +- 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 amm-ui/.gitignore diff --git a/amm-ui/.gitignore b/amm-ui/.gitignore new file mode 100644 index 0000000..7274a4b --- /dev/null +++ b/amm-ui/.gitignore @@ -0,0 +1,3 @@ +result +result-* +modules/ diff --git a/amm-ui/README.md b/amm-ui/README.md index 1eaa3e3..dc85025 100644 --- a/amm-ui/README.md +++ b/amm-ui/README.md @@ -12,7 +12,15 @@ This project requires Nix with experimental features enabled. If you haven't alr mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf ``` -## Running the UI +Install the Logos package manager CLI globally (one-time): + +```bash +nix profile install 'github:logos-co/logos-package-manager#cli' +``` + +This makes `lgpm` available as a global command. + +## Running the UI standalone Start the UI with: @@ -20,7 +28,55 @@ Start the UI with: nix run . ``` -This builds and runs the application in development mode. +This builds and runs the application in development mode. The Logos bridge is unavailable in standalone mode, but the UI layout and mock data are fully functional. + +## Running inside Logos Basecamp + +### 1. Build the LGX package + +```bash +# Development variant (requires nix store at runtime) +nix build '.#lgx' --out-link result-lgx + +# Portable variant (self-contained, works without nix) +nix build '.#lgx-portable' --out-link result-lgx-portable +``` + +### 2. Install into Basecamp + +```bash +# Launch Basecamp once to initialise its data directory, then quit +nix run 'github:logos-co/logos-basecamp' + +# Set the data directory path +# macOS: +BASECAMP_DIR="$HOME/Library/Application Support/Logos/LogosBasecampDev" +# Linux: +# BASECAMP_DIR="$HOME/.local/share/Logos/LogosBasecampDev" + +# Install the UI plugin +lgpm --ui-plugins-dir "$BASECAMP_DIR/plugins" \ + install --file result-lgx/*.lgx +``` + +> **Note:** Use matching variants throughout — dev with dev, portable with portable. Mixing variants causes loading failures. The portable build uses the `LogosBasecamp` data directory instead of `LogosBasecampDev`. + +### 3. Launch Basecamp + +```bash +nix run 'github:logos-co/logos-basecamp' +``` + +This fetches, builds, and launches Basecamp in one step. The AMM UI appears as a new tab in the Basecamp sidebar. + +### Installing via the Basecamp UI + +Alternatively, use the built-in package manager: + +1. Launch Basecamp +2. Open Package Manager +3. Select "Install from file" +4. Choose the `.lgx` file from `result-lgx/` ## Updating Dependencies @@ -29,3 +85,18 @@ To update the pinned versions of dependencies in `flake.lock`: ```bash nix flake update ``` + +## Troubleshooting + +**Stale QML cache after rebuild:** +```bash +QML_DISABLE_DISK_CACHE=1 nix run 'github:logos-co/logos-basecamp' +``` + +**Reset Basecamp data directory:** +```bash +# macOS +rm -rf ~/Library/Application\ Support/Logos/LogosBasecampDev +# Linux +rm -rf ~/.local/share/Logos/LogosBasecampDev +``` diff --git a/amm-ui/flake.nix b/amm-ui/flake.nix index 99f99dd..6d873cd 100644 --- a/amm-ui/flake.nix +++ b/amm-ui/flake.nix @@ -1,5 +1,5 @@ { - description = "Logos QML UI Module — replace with your description"; + description = "Logos Swap — Decentralized, privacy preversed trading"; inputs = { logos-module-builder.url = "github:logos-co/logos-module-builder";