Skip to main content

Interface: SnapOptions24

Options for building a core24 snap. This interface does not extend the legacy SnapBaseOptions — it uses the snapcraft CLI directly.

Fields inherited from CommonLinuxOptions (description, category, mimeTypes, executableArgs, desktop, synopsis) are automatically populated from the root linux.* configuration. You do not need to duplicate them here; values set directly on this interface take precedence over the cascaded linux.* values.

Extends​

Properties​

after?​

readonly optional after?: string[] | null

Names of other snapcraft parts that must be built before the app part.


appPartStage?​

readonly optional appPartStage?: string[] | null

Filesets controlling which files from the app part are staged into the snap. Supports glob patterns and exclusions. See filesets.


artifactName?​

readonly optional artifactName?: string | null

The artifact file name template.

Inherited from​

TargetSpecificOptions.artifactName


assumes?​

readonly optional assumes?: string | string[] | null

Features that must be supported by the host snapd before the snap can be installed. See assumes.


autoStart?​

readonly optional autoStart?: boolean

Whether the app should auto-start on login (creates an autostart desktop entry).

Default​

false

buildPackages?​

readonly optional buildPackages?: string[] | null

Debian packages required at build time (installed inside the build environment).


category?​

readonly optional category?: string | null

The application category.

Inherited from​

CommonLinuxOptions.category


compression?​

readonly optional compression?: "xz" | "lzo" | null

Compression algorithm for the snap SquashFS image.

  • xz — smaller file, slower decompression (recommended for distribution).
  • lzo — larger file, faster decompression (useful for development iteration). Omit to use snapcraft's default (xz).

When not set, linux.compression is mapped automatically: "store" → "lzo", "maximum" → "xz", "normal" → snapcraft default. Explicitly setting this field always overrides the mapped value.


confinement?​

readonly optional confinement?: "strict" | "classic" | "devmode" | null

The type of confinement supported by the snap.

Default​

strict

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


environment?​

readonly optional environment?: {[key: string]: string; } | null

Additional environment variables injected into the snap's runtime environment. Merged with the electron-builder defaults (TMPDIR=$XDG_RUNTIME_DIR). User-supplied values take precedence.


executableArgs?​

readonly optional executableArgs?: string[] | null

The executable parameters. Pass to executableName

Inherited from​

CommonLinuxOptions.executableArgs


extensions?​

readonly optional extensions?: string[] | null

Snapcraft extensions to apply to the app. Defaults to ["gnome"] in normal builds (recommended for Electron apps on Ubuntu 24.04+). Automatically set to [] in useDestructiveMode builds, where the gnome extension is incompatible. Explicitly including "gnome" while useDestructiveMode is set will throw. See: https://documentation.ubuntu.com/snapcraft/stable/reference/extensions/gnome-extension/


forceX11?​

readonly optional forceX11?: boolean | null

Set to true to force X11 by injecting --ozone-platform=x11 into the snap command line. When unset or false, no flag is injected and native Wayland is allowed. Unlike the legacy snap.allowNativeWayland, there is no electron-version-based default here — core24 always allows Wayland unless this is explicitly true.


grade?​

readonly optional grade?: "devel" | "stable" | null

The quality grade of the snap. devel — not publishable to stable/candidate channels. stable — suitable for all channels.

Default​

stable

hooks?​

readonly optional hooks?: string | null

Directory containing snap hooks, relative to the build resources directory.

Default​

build/snap-hooks

layout?​

readonly optional layout?: {[key: string]: object; } | null

Snap layouts — bind-mount or symlink host paths into the snap's namespace. User-provided layouts always override the extension defaults.


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


plugs?​

readonly optional plugs?: PlugDescriptor | (string | PlugDescriptor)[] | null

Plugs (consumed interfaces) for the app.

When unset, electron-builder declares its default plug set: browser-support (without allow-sandbox, so the app is launched with --no-sandbox), plus — unless the gnome extension supplies them — the app-level plugs ["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"] and, for strict builds that are not host/destructive-mode, the content-snap plugs gtk-3-themes, icon-themes, sound-themes, gnome-46-2404 and gpu-2404.

Include "default" to add to that set instead of replacing it: the result is the full default set (the app-level plugs above plus everything the build flavor declares on its own) together with your other entries, deduplicated by plug name. A descriptor object named like a default plug overrides that plug's attributes. A null descriptor resets a default plug named like its interface (browser-support) to the snapd defaults, and removes a default content-snap plug (gtk-3-themes, icon-themes, sound-themes, gnome-46-2404, gpu-2404) from the snap; the default layout binds into gnome-46-2404 and gpu-2404, so set layout too when removing those. Without "default", the list replaces the defaults entirely.

["default", "camera", { "home": { "read": "all" } }]

Supports descriptor objects for plugs with attributes:

[{ "dot-config-app": { "interface": "personal-files", "write": ["$HOME/.config/app"] } }]

The Snap Store reserves browser-support's allow-sandbox attribute for vetted publishers and rejects other uploads that request it; electron-builder warns when it is set.


publish?​

optional publish?: Publish

Inherited from​

TargetSpecificOptions.publish


remoteBuild?​

readonly optional remoteBuild?: RemoteBuildOptions | null

Configuration for a remote build on Launchpad. Enables cross-architecture builds in CI without native hardware or nested virtualisation. Set remoteBuild.buildFor: ["amd64", "arm64"] to build several architectures in one Launchpad job, or the top-level arch: ["x64", "arm64"] option to spawn a separate job per architecture (the two are mutually exclusive).


slots?​

readonly optional slots?: SlotDescriptor | (string | SlotDescriptor)[] | null

Slots (provided interfaces) for the app. Use for MPRIS, D-Bus services, etc.

Example — expose MPRIS under the Chromium bus name:

[{ "mpris": { "name": "chromium" } }]

stagePackages?​

readonly optional stagePackages?: string[] | null

Ubuntu packages to stage alongside the app (equivalent to depends for deb). Defaults to ["libnspr4", "libnss3", "libxss1", "libappindicator3-1", "libsecret-1-0"]. Supports the "default" keyword to reference the default list: ["default", "my-extra-lib"] appends my-extra-lib to the defaults.


summary?​

readonly optional summary?: string | null

A short summary of the snap (max 78 characters). Defaults to productName.


synopsis?​

readonly optional synopsis?: string | null

The short description.

Inherited from​

CommonLinuxOptions.synopsis


title?​

readonly optional title?: string | null

An optional display title (may contain uppercase letters and spaces). Defaults to productName. See snap format.


useDestructiveMode?​

readonly optional useDestructiveMode?: boolean | null

Build directly on the host without an isolated VM or container (snapcraft --destructive-mode). Equivalent to setting SNAPCRAFT_BUILD_ENVIRONMENT=host.

Not recommended for most use cases. Destructive mode pollutes the host environment and produces builds that are difficult to reproduce — any library or tool present on the host at build time can silently end up in the snap. Prefer useLXD or useMultipass for clean, reproducible builds; use remoteBuild for multi-architecture CI.

Valid reasons to enable this option:

  • Building inside a Docker container where nested virtualisation (LXD / Multipass) is unavailable and a remote Launchpad build is not acceptable.
  • Running test suites in CI where the environment is already fully controlled.

The gnome extension is incompatible with this mode enabled — do not include it in extensions.

See​

https://snapcraft.io/docs/build-options


useLXD?​

readonly optional useLXD?: boolean | null

Use LXD as the isolated build environment. Preferred over Multipass on most Linux CI systems where nested virtualisation is unavailable. Mutually exclusive with useMultipass and useDestructiveMode.


useMultipass?​

readonly optional useMultipass?: boolean | null

Use Multipass as the isolated build environment. Mutually exclusive with useLXD and useDestructiveMode.