Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface SnapcraftOptions

Any options that aren't specified here are passed through to the snapcraft.yaml file via [[SnapcraftConfig]].

Hierarchy

  • SnapcraftOptions

Index

Properties

Optional appConfig

appConfig: Record<string, unknown>

Additional app-specific Snapcraft configuration for the Electron app. This is different from [[SnapcraftConfig]] in that it is scoped under apps.<app-name>.

Optional appPlugs

appPlugs: string[]

Additional plugs for the Electron app, which are necessary for the app to be a consumer of a feature in the system. Common features can be set via the features option. To set any attributes for the plugs, set them in the plugs option.

For example, if the app uses a DBus interface:

{
  appPlugs: ['my-dbus-interface'],
  plugs: {
    'my-dbus-interface': {
      interface: 'dbus',
      name: 'com.example.my-interface',
      bus: 'session'
    }
  }
}

plugs will be passed through directly to the generated snapcraft.yaml.

Optional appSlots

appSlots: string[]

Additional slots for the Electron app, which are necessary for the app to be a producer of a feature in the system. Common features can be set via the features option. To set any attributes for the plugs, set them in the slots option.

For example, if the app creates a DBus interface:

{
  appSlots: ['my-dbus-interface'],
  slots: {
    'my-dbus-interface': {
      interface: 'dbus',
      name: 'com.example.my-interface',
      bus: 'session'
    }
  }
}

slots will be passed through directly to the generated snapcraft.yaml.

Optional arch

arch: string

Either the Node.js-formatted arch or Snap-formatted arch, used to specify the Snap's target arch.

Default: the host arch, via process.arch.

Optional confinement

confinement: "strict" | "devmode" | "classic"

Default: devmode

Optional description

description: string

The longer description for the snap. Can contain newlines.

Optional desktopTemplate

desktopTemplate: string

The absolute path to a custom Freedesktop.org desktop file template.

Optional dest

dest: string

The directory where the .snap file is created.

Default: the current working directory.

Optional executableName

executableName: string

The executable name of the Electron app, sans file extension. Corresponds to the executableName option in Electron Packager.

Default: either productName or name in package.json

Optional features

features: { alsa?: true; audio?: true; browserSandbox?: false; mpris?: string; passwords?: true; webgl?: true }

Describes what functionality the Electron app needs, in order to work inside the Snap sandbox.

Example:

{
  features: {
    audio: true,
    mpris: 'com.example.mpris',
    webgl: true
  }
}

Setting a feature to a false-y value does not disable the feature, only omitting the feature from the Object does that.

Type declaration

  • Optional alsa?: true

    Audio support via ALSA (replaces audio support if both are specified)

  • Optional audio?: true

    Audio support via PulseAudio.

  • Optional browserSandbox?: false

    Web browser functionality. This was originally enabled by default when using Electron ≥ 5.0.0, due to the setuid sandbox support. However, Snapcraft allows for use of the snap confined sandbox, particularly within strict confinement. We should encourage but not enforce the browser-sandbox plug.

  • Optional mpris?: string

    MPRIS support.

    If enabled, the interface name must be specified as the feature value.

  • Optional passwords?: true

    Access the secret service (e.g., GNOME Keyring)

  • Optional webgl?: true

    WebGL support (requires Mesa, etc.)

Optional grade

grade: "devel" | "stable"

The quality grade of the Snap. See the Snapcraft documentation for valid values.

Default: devel

Optional hookScripts

hookScripts: Record<string, string>

One or more hook scripts to be installed with the Snap. The format of the Object is { hookName: pathToHookScript, […] }. Hook names can be found in the Snapcraft documentation.

Optional layouts

layouts: Record<string, Record<string, unknown>>

Modifies the execution environment of a strictly-confined snap.

Optional name

name: string

The name of the Snap package.

Default: name in package.json

Optional plugs

plugs: Record<string, Record<string, unknown>>

See appPlugs for details.

Optional slots

slots: Record<string, Record<string, unknown>>

See appSlots for details.

Optional snapcraft

snapcraft: string

The absolute path to the snapcraft executable.

By default, it searches paths in the PATH environment variable.

src

src: string

Optional summary

summary: string

A 78 character long summary for the Snap.

Default: description in package.json

Optional version

version: string

The version of the Snap package.

Default: version in package.json

Generated using TypeDoc