mirror of
https://github.com/TriliumNext/Trilium.git
synced 2026-10-12 02:09:59 +00:00
The `start-prod`/`start-prod-no-dir` scripts invoked the npm prebuilt Electron binary directly (`electron dist`), which fails to load on NixOS because it's dynamically linked against FHS system libraries that don't exist there (libcups.so.2, libgtk-3, libnss3, ...). The dev launcher already handles this via electron-start.mts, but prod never did. Add scripts/electron-run-prod.mts, a build-free launcher that reuses the same NixOS-aware getElectronPath() (preferring the Nix/nix-develop Electron over the prebuilt binary) and sets LD_LIBRARY_PATH plus --no-sandbox on NixOS. On all other platforms it's a transparent `electron <args>` wrapper, so behaviour is unchanged. Also extract the shared getNixLdLibraryPath() helper so the dev and prod launchers stay DRY. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>