trilium/scripts
Elian Doran cbb1d53f25
fix(desktop): make start-prod launch Electron correctly on NixOS
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) <noreply@anthropic.com>
2026-07-18 13:29:30 +03:00
..
icon-packs feat(icon-pack-builder): integrate boxicons 3 with brands 2025-12-28 22:53:03 +02:00
icons feat(mobile/ios): add trilium icon 2026-04-22 14:43:10 +03:00
repo-migration chore(scripts): add proper typechecking 2025-12-08 14:13:18 +02:00
translation chore(scripts): improve messages for translation check script 2026-02-06 19:38:24 +02:00
analyze-perf.ts Revert "chore(scripts): remove analyze-perf" 2026-01-11 10:55:47 +02:00
build-utils.ts fix(desktop): don't inject import.meta.url banner into sandboxed preload 2026-07-13 14:36:01 +03:00
check-version-consistency.ts fix(ci): sanity check does not account for version prefix 2026-03-01 17:43:41 +02:00
electron-rebuild.mts fix(nix): not handling sqlite natives 2026-05-19 18:22:30 +03:00
electron-run-prod.mts fix(desktop): make start-prod launch Electron correctly on NixOS 2026-07-18 13:29:30 +03:00
electron-start.mts fix(desktop): make start-prod launch Electron correctly on NixOS 2026-07-18 13:29:30 +03:00
filter-tsc-output.mts chore(scripts): integrate filter-tsc-output from standalone branch 2026-04-01 16:39:54 +03:00
generate-openapi.ts feat(views/geomap): remove old geo map type 2025-07-06 20:23:50 +03:00
tsconfig.json chore(scripts): fix typecheck issue 2026-01-04 23:38:51 +02:00
update-build-info.ts fix(scripts): update build info no longer updating 2026-04-07 16:00:44 +03:00
update-contributors.ts contributor list: update script name, change a comment 2026-04-19 18:33:35 +03:00
update-nightly-version.ts refactor(standalone): rename project from client-standalone 2026-05-16 08:57:55 +03:00
update-version.ts refactor(standalone): rename project from client-standalone 2026-05-16 08:57:55 +03:00
utils.mts fix(desktop): make start-prod launch Electron correctly on NixOS 2026-07-18 13:29:30 +03:00
wipe-node-modules.mts chore(scripts): add a way to wipe node modules 2026-03-26 11:27:46 +02:00