Skip to main content

Interface: FlatpakOptions

Desktop-entry and runtime fields shared by all Linux targets and all snap core strategies.

Fields set under linux.* in your build config (i.e. on LinuxConfiguration) are automatically cascaded into each snap core's options by LinuxTargetHelper.getSnapCore(). You do not need to duplicate them under snapcraft.core24.*, snapcraft.core22.*, etc. Per-core values always take precedence when both are set.

Extends​

Properties​

additionalArgs?​

readonly optional additionalArgs?: FlatpakAdditionalArgs | null

Advanced only Additional arguments for the tools that build the bundle, by tool. Nothing is added unless it is set.

A build in an unprivileged container, which has neither FUSE nor user namespaces for bubblewrap, needs { flatpakBuilder: ["--disable-rofiles-fuse"], buildExport: ["--disable-sandbox"] }.


artifactName?​

readonly optional artifactName?: string | null

The artifact file name template.

Inherited from​

TargetSpecificOptions.artifactName


base?​

readonly optional base?: string

Start with the files from the specified application. This can be used to create applications that extend another application. Defaults to org.electronjs.Electron2.BaseApp.

See flatpak manifest documentation.


baseVersion?​

readonly optional baseVersion?: string

Use this specific version of the application specified in base. It is not derived from runtimeVersion. Defaults to 26.08.

See flatpak manifest documentation.


branch?​

readonly optional branch?: string

The branch to use when exporting the application. Defaults to master.

See flatpak manifest documentation.


category?​

readonly optional category?: string | null

The application category.

Inherited from​

CommonLinuxOptions.category


description?​

readonly optional description?: string | null

As description from application package.json, but allows you to specify different for Linux.

Inherited from​

CommonLinuxOptions.description


desktop?​

readonly optional desktop?: LinuxDesktopFile | null

The Desktop file

Inherited from​

CommonLinuxOptions.desktop


executableArgs?​

readonly optional executableArgs?: string[] | null

The executable parameters. Pass to executableName

Inherited from​

CommonLinuxOptions.executableArgs


files?​

readonly optional files?: [string, string][]

Extra files and directories for the app, as [source, destination] pairs. A source is a path on the build machine; a relative one is resolved against the current working directory. A destination is a path relative to the app prefix, which is /app inside the sandbox: ["build/extra.so", "/lib/extra.so"] ends up at /app/lib/extra.so. A directory is merged into a destination that already exists. For a file, the destination is the path of the file itself, not of the directory that receives it. The pairs are copied in order, after the app itself, so a later pair can replace what an earlier one placed. A destination outside the app prefix (one that climbs out of it with .., or that leads out of it through a symlink placed by the base app, a module or an earlier pair) fails the build.


finishArgs?​

readonly optional finishArgs?: string[]

An array of arguments passed to the flatpak build-finish command: the permissions of the sandboxed app. Setting it replaces the default list. The defaults are broad grants for a typical Electron app, not requirements: each one widens what code running in the app can reach, see Finish Args. Defaults to:

[
// Wayland/X11 Rendering
"--socket=wayland",
"--socket=x11",
"--share=ipc",
// Open GL
"--device=dri",
// Sound: playback and recording (microphone included), MIDI and the /dev/snd devices
"--socket=pulseaudio",
// Read/write access to the Downloads folder only
"--filesystem=xdg-download",
// Allow communication with network
"--share=network",
]

When base is the default org.electronjs.Electron2.BaseApp and baseVersion is older than 23.08, the default list also has "--talk-name=org.freedesktop.Notifications", for system notifications: those base apps ship a libnotify older than 0.8, which talks to the notification daemon instead of the notification portal.

Before v27 the default list had --filesystem=home, read/write access to the whole home directory, instead of --filesystem=xdg-download, and always had --talk-name=org.freedesktop.Notifications.

See flatpak manifest documentation.


installOrUpdateRefs?​

readonly optional installOrUpdateRefs?: "all" | ("base" | "runtime" | "sdk")[] | null

Which of the runtime, the SDK and the base app the build installs when they are missing and updates when they are installed: "all", or a list of "runtime", "sdk" and "base". A ref that is left out is neither installed nor updated: the build uses it as it is installed on the build machine, for the user or system-wide, and fails before it installs or builds anything if it is not installed. Set [] to build with the refs that are already installed, for example in an image that has them, without network access, or where the build user cannot update them. Defaults to "all".


license?​

readonly optional license?: string | null

The path to EULA license file. Defaults to license.txt or eula.txt (or uppercase variants). Only plain text is supported.


mimeTypes?​

readonly optional mimeTypes?: string[] | null

The mime types in addition to specified in the file associations. Use it if you don't want to register a new mime type, but reuse existing.

Inherited from​

CommonLinuxOptions.mimeTypes


modules?​

readonly optional modules?: any[]

An array of objects specifying the modules to be built in order. Modules are built in a bubblewrap sandbox, so they cannot be built where bubblewrap cannot create namespaces, such as an unprivileged container.

See flatpak manifest documentation.


publish?​

optional publish?: Publish

Inherited from​

TargetSpecificOptions.publish


runtime?​

readonly optional runtime?: string

The name of the runtime that the application uses. Defaults to org.freedesktop.Platform.

See flatpak manifest documentation.


runtimeVersion?​

readonly optional runtimeVersion?: string

The version of the runtime that the application uses, which is also the version of the SDK. Defaults to 26.08. Set it together with baseVersion.

See flatpak manifest documentation.


sdk?​

readonly optional sdk?: string

The name of the development runtime that the application builds with. Defaults to org.freedesktop.Sdk.

See flatpak manifest documentation.


readonly optional symlinks?: [string, string][]

Symlinks for the app, as [target, link] pairs. Both are paths relative to the app prefix, which is /app inside the sandbox: ["/lib/tool", "/bin/tool"] creates /app/bin/tool, pointing at /app/lib/tool. The links are created after the files are copied. A link outside the app prefix (also through a symlink that leads out of it) fails the build.


synopsis?​

readonly optional synopsis?: string | null

The short description.

Inherited from​

CommonLinuxOptions.synopsis


useWaylandFlags?​

readonly optional useWaylandFlags?: boolean

Whether the wrapper script makes Electron use Wayland when the session is a Wayland one (XDG_SESSION_TYPE is wayland). The flags depend on the Electron version: none from Electron 38, which picks Wayland there by itself (the build logs that the option has no effect), --ozone-platform=wayland from Electron 16, and --enable-features=UseOzonePlatform --ozone-platform=wayland before that. Electron 12 or later is required. Defaults to false.