Files
claude-desktop-debian/scripts
aaddrick a326ea2013 fix(nix): enable isPackaged=true by co-locating Electron binary with app resources
On NixOS, Electron and the app live in separate Nix store paths.
When ELECTRON_FORCE_IS_PACKAGED=true, the app reads locale files
(en-US.json) from process.resourcesPath at module load time —
before frame-fix-wrapper.js can correct the path. Since
resourcesPath is computed from /proc/self/exe (which resolves to
electron-unwrapped's store path), the files aren't found and the
app crashes with ENOENT.

The fix copies the Electron ELF binary into a custom tree within
the derivation, then merges both Electron's and the app's resources
into the adjacent resources/ directory. Everything else (shared
libs, .pak files, locales/) is symlinked to avoid duplication.
This makes /proc/self/exe resolve to our tree, so resourcesPath
naturally contains all needed files.

Also enables ELECTRON_FORCE_IS_PACKAGED=true unconditionally for
all package types, removing the 'nix' special case that kept NixOS
running in development mode with debug logging and exposed IPC.

Fixes #316

Co-Authored-By: Claude <claude@anthropic.com>
2026-04-01 05:38:01 -04:00
..