Technical notes for developers working on the Flatpak build.
Offline-first: flatpak-node-generator converts Yarn lockfiles into
generated-sources.json so builds need no network. Yarn pulls from an offline
mirror inside the sandbox.
Build stages (in the SDK sandbox):
yarn install-- offline dependency fetch_install_app,subprojects_app,_assets_app,build_dist-- compile toapp/electron-builder-- package app with Electron runtime todist/linux-unpacked/- Copy
dist/linux*-unpacked/to/app/main dotnet-runtimemodule -- stage .NET runtime
See flatpak/com.nexusmods.vortex.yaml for per-phase commands and environment variables.
Builds/installs when needed, then runs the installed app:
python flatpak/scripts/flatpak_run.pyExports to a local OSTree repo and installs the app:
python flatpak/scripts/flatpak_install.pyThis approach:
- Exports build to
flatpak/flatpak-repo/(OSTree repository) - Adds the repo as a flatpak remote
- Installs the app from the repo
- The app now appears in software centers (KDE Discover, GNOME Software)
Use this to test the actual user installation experience.
child-concurrency 1-- deterministic, avoids cache racesyarn-offline-mirror-- tarball store inside the sandboxyarn-offline-mirror-pruning false-- don't delete needed tarballscache-folder-- writable cache in the sandbox
flatpak/run.sh launches with zypak-wrapper /app/main/vortex.
- Zypak runs Electron inside the sandbox (see Zypak docs)
- Desktop file points to
run.sh - Entrypoint must use Zypak per Flatpak Electron guidance
-
Full host filesystem access: Game installs can be anywhere. Deployment uses hardlinks, symlinks, and moves. Portals are not viable because scanning and deployment are background operations that cannot wait for user prompts.
-
Offline builds: Required for Flathub and reproducible builds. All Yarn and NPM dependencies must be in
generated-sources.json. -
Zypak wrapper: Required by the Electron BaseApp to run Chromium's sandbox inside Flatpak's sandbox.
-
.NET runtime staging: Framework-dependent tools such as
dotnetprobeneedDOTNET_ROOTpointing to the staged runtime at/app/lib/dotnet. -
Electron builder: We use
electron-builderwith thedirtarget to package the app with the Electron runtime. This creates a complete distribution indist/linux-unpacked/that gets copied to/app/main.