feat(build): add Nix devshell, FHS binary patching, Linux .deb packaging
Supersedes #45. Depends on #59.
Rebased on current develop, all pre-commit checks passing (biome, tsc, cargo check). Corrections from #45:
beforeBundleCommandmoved fromtauri.conf.jsontotauri.linux.conf.jsonso Windows and macOS builds are unaffectedexternalBin: []retained on Linux to eliminate/usr/bin/yt-dlpfile conflict with the systemyt-dlppackage (dpkg refuses to install both)ffmpegandyt-dlpdeclared asRecommendsinstead ofDepends—.debinstalls successfully without them present, uses them automatically when available via PATH-first resolution from #59
Verified: .deb builds, installs over existing v0.12.0 package without conflicts, and launches on Pop!_OS 24.04 with system yt-dlp (PPA 2026.03.17) and ffmpeg resolved via PATH.
Problem
Building Youwee inside a Nix devshell produces binaries with a Nix store dynamic linker (/nix/store/.../ld-linux-x86-64.so.2) and Nix store RPATH entries baked into the ELF binary. When this binary is packaged into a .deb and installed on a standard Ubuntu/Debian system, it crashes at launch because the Nix linker cannot find system libraries like libayatana-appindicator3.so.1.
The existing .deb bundles yt-dlp at /usr/bin/yt-dlp via externalBin, which conflicts with the yt-dlp apt package — dpkg refuses to install both.
There is no Nix flake or devshell configuration, so Linux contributors using Nix must manually discover and install all Tauri 2 system dependencies (GTK3, WebKitGTK 4.1, OpenSSL, libayatana-appindicator, pkg-config, etc.).
Solution
FHS binary portability (scripts/patch-fhs-binary.sh)
Called by tauri.linux.conf.json beforeBundleCommand after cargo build but before .deb/.rpm/.AppImage assembly:
- Patches ELF interpreter from Nix store to standard FHS path (
/lib64/ld-linux-x86-64.so.2) - Removes RPATH so the binary uses the system library search path
- Multi-arch support: x86_64, aarch64, armv7l, i686 (via
TAURI_ENV_ARCH) - Derives binary path dynamically from
TAURI_ENV_TARGET_TRIPLEandTAURI_ENV_DEBUG - No-op when patchelf is not on PATH (macOS, Windows, CI without Nix)
- Idempotent: skips if interpreter already points to FHS path
- Fails loudly (exits non-zero, aborts tauri build) if patchelf is available but patching fails
Linux .deb packaging (tauri.linux.conf.json)
Defense in depth — three layers of binary resolution, each catching the one above failing:
- System PATH — user or fleet has deployed managed binaries (Nix, Homebrew, PPA, Ansible, etc.). Highest-trust source. PATH-first resolution from #59 makes this work automatically.
- App-managed download — user installed via Settings > Dependencies, or the app auto-downloaded Stable channel on first launch. Lives in
app_data_dir/bin/. - Bundled sidecar — ships inside the
.dmg/.msion macOS/Windows. On Linux,externalBin: []removes the bundled sidecar to eliminate the/usr/bin/yt-dlpfile conflict with the system package. Layers 1 and 2 provide coverage.
Implementation:
externalBin: []on Linux — removes bundled yt-dlp from.deb, eliminating dpkg file conflict with theyt-dlpapt packageRecommends(notDepends) forffmpegandyt-dlp—aptinstalls them by default when available, succeeds even when they are not- No configuration required at any layer. Fleet operators who push system packages get theirs preferred. Home users get the app-managed auto-download on first launch.
Nix devshell (flake.nix, flake.lock, .envrc)
flake.nixconsumesgithub:braincraftio/konductorfrontend devshell viainputsFrom, providing Rust toolchain, Bun, Node.js, pkg-config, and all Tauri 2 system library dependencies (GTK3, WebKitGTK 4.1, OpenSSL, libayatana-appindicator, etc.)- Adds runtime packages on PATH:
yt-dlp(video extraction),ffmpeg(post-processing),deno(yt-dlp YouTube JS extraction via--js-runtimes),glib-networking(GnuTLS backend for GIO — required by WebKitGTK for HTTPS) - Sets
GIO_EXTRA_MODULESto${pkgs.glib-networking}/lib/gio/modules:${pkgs.dconf.lib}/lib/gio/modulesfor WebKitGTK TLS support — without this, HTTPS image loads fail with "TLS support is not available" flake.lockpinned to konductor rev84a1bcd(includespkgs.bun).envrcsources$HOME/.cargo/envfor Rust toolchain and provides commented-outuse flakefor opt-in direnv integration
README updates
- Documents optional system dependencies for Linux
.debusers with PPA instructions - Documents
nix develop→bun install→bun run tauri devworkflow - Updates Tauri prerequisites link from deprecated v1 to current v2
- Tech stack clarifies yt-dlp is bundled on macOS/Windows, system packages optional on Linux
Test plan
- [ ]
nix developenters devshell withbun,cargo,rustc, all Tauri deps - [ ]
bun run tauri devlaunches development build with working thumbnails and TLS - [ ]
bun run tauri build -b debproduces.debwith FHS-patched binary - [ ]
beforeBundleCommandoutput confirms interpreter patched from Nix store to/lib64/ld-linux-x86-64.so.2 - [ ]
.debdoes not contain bundled yt-dlp binary (no/usr/bin/yt-dlpfile conflict) - [ ]
.debdeclaresRecommends: ffmpeg, yt-dlp(notDepends) - [ ]
sudo apt install ./Youwee.debsucceeds without ffmpeg or yt-dlp pre-installed - [ ]
sudo apt install ./Youwee.debsucceeds when system yt-dlp already installed via PPA - [ ] Installed app launches and uses app-managed yt-dlp download when system binary absent
- [ ] Installed app prefers system yt-dlp/ffmpeg when present via PATH
- [ ] macOS and Windows builds unaffected (
beforeBundleCommandonly in Linux platform config,tauri.conf.jsonunchanged) - [ ] Non-Nix Linux builds unaffected (patch script no-ops when patchelf absent)