From 505b33e4dc17856b09ff1697a98936f78810702a Mon Sep 17 00:00:00 2001 From: "Marcus (agent-cos)" Date: Fri, 15 May 2026 20:59:28 -0700 Subject: [PATCH] Remove logos-install; logos is now self-bootstrapping On first run, logos auto-creates the WINE prefix and launches the installer if Logos.exe isn't found. No separate install step needed. nix run github:sscoble/logos-app -- that's it. --- flake.lock | 61 +++++++++++++++++++++++++++++ flake.nix | 112 ++++++++++++++++++++--------------------------------- 2 files changed, 104 insertions(+), 69 deletions(-) create mode 100644 flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..cd56566 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1778443072, + "narHash": "sha256-zi7/fsqM/kFdNuED//4WOCUtezGtKKqRNORjMvfwjnA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "da5ad661ba4e5ef59ba743f0d112cbc30e474f32", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index e87c09c..4d0caf9 100644 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,10 @@ let pkgs = nixpkgs.legacyPackages.${system}; - # Shared user data path for persistent storage dataDir = "$HOME/.local/share/logos-app"; # ── Electron web wrapper ────────────────────────── - logos-electron = pkgs.writeShellApplication { + logos-web = pkgs.writeShellApplication { name = "logos-web"; runtimeInputs = [ pkgs.electron ]; text = '' @@ -24,64 +23,56 @@ ''; }; - # ── WINE launcher (after desktop install) ────────── - logos-wine = pkgs.writeShellApplication { + # ── WINE launcher (self-bootstrapping) ──────────── + logos = pkgs.writeShellApplication { name = "logos"; - runtimeInputs = [ pkgs.wineWow64Packages.stagingFull ]; + runtimeInputs = with pkgs; [ + wineWow64Packages.stagingFull + winetricks + wget + ]; text = '' WINEPREFIX="''${WINEPREFIX:-$HOME/.local/share/logos-wine}" export WINEPREFIX WINEARCH=win64 LOGOS_EXE="$WINEPREFIX/drive_c/users/$USER/AppData/Local/Logos/Logos.exe" - if [ ! -f "$LOGOS_EXE" ]; then - echo "Logos not installed yet. Run: logos-install" - exit 1 - fi - - exec wine "$LOGOS_EXE" "$@" - ''; - }; - - # ── Installer script ─────────────────────────────── - logos-install = pkgs.writeShellApplication { - name = "logos-install"; - runtimeInputs = with pkgs; [ wineWow64Packages.stagingFull winetricks wget ]; - text = '' - set -e - WINEPREFIX="''${WINEPREFIX:-$HOME/.local/share/logos-wine}" - export WINEPREFIX WINEARCH=win64 - - if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then - echo "ERROR: No display. Run from your desktop, not SSH." - exit 1 - fi - - echo "=== Logos Installer ===" - - # Init WINE prefix + # ── Self-bootstrap: create prefix if missing ── if [ ! -d "$WINEPREFIX" ]; then - echo "[1/3] Creating WINE prefix..." + echo "═══ First run: initializing WINE prefix ═══" wineboot -i && wineserver -w winecfg -v win10 - winetricks -q corefonts - else - echo "[1/3] WINE prefix exists" + winetricks -q corefonts 2>/dev/null + echo "✓ WINE prefix ready" + echo "" fi - # Download installer - INSTALLER="/tmp/LogosSetup.exe" - if [ ! -f "$INSTALLER" ]; then - echo "[2/3] Downloading Logos installer..." - wget -q --show-progress -O "$INSTALLER" \ - "https://downloads.logoscdn.com/LBS10/Installer/LogosSetup.exe" - else - echo "[2/3] Installer cached" + # ── Self-bootstrap: download + run installer if Logos missing ── + if [ ! -f "$LOGOS_EXE" ]; then + echo "═══ Logos not installed — launching installer ═══" + INSTALLER="''${XDG_CACHE_HOME:-$HOME/.cache}/LogosSetup.exe" + mkdir -p "$(dirname "$INSTALLER")" + if [ ! -f "$INSTALLER" ]; then + echo "Downloading installer..." + wget -q --show-progress -O "$INSTALLER" \ + "https://downloads.logoscdn.com/LBS10/Installer/LogosSetup.exe" + fi + echo "" + echo "→ Follow the Logos setup wizard to sign in and download your library." + echo "→ Next time you run 'logos' it will launch directly." + echo "" + wine "$INSTALLER" || { + echo "Installer exited. If Logos is installed, re-run 'logos'." + exit 1 + } fi - echo "[3/3] Running installer — follow the GUI..." - wine "$INSTALLER" - echo "Done. Launch with: logos" + if [ -f "$LOGOS_EXE" ]; then + exec wine "$LOGOS_EXE" "$@" + else + echo "Logos not found after install. Try running again." + exit 1 + fi ''; }; @@ -109,35 +100,18 @@ in { packages = { - default = logos-wine; - logos = logos-wine; - logos-web = logos-electron; - logos-install = logos-install; + default = logos; + logos = logos; + logos-web = logos-web; logos-full = pkgs.symlinkJoin { name = "logos-full"; - paths = [ - logos-wine - logos-electron - logos-install - logos-desktop - logos-web-desktop - ]; + paths = [ logos logos-web logos-desktop logos-web-desktop ]; }; }; apps = { - default = { - type = "app"; - program = "${logos-wine}/bin/logos"; - }; - web = { - type = "app"; - program = "${logos-electron}/bin/logos-web"; - }; - install = { - type = "app"; - program = "${logos-install}/bin/logos-install"; - }; + default = { type = "app"; program = "${logos}/bin/logos"; }; + web = { type = "app"; program = "${logos-web}/bin/logos-web"; }; }; devShells.default = pkgs.mkShell {