Skip to content

Environment Variables

Reference for all environment variables onelf reads or sets.

Set by the runtime (visible to the packed app)

VariableValue
ONELF_DIRAbsolute path to the package root (FUSE mount, tmpfs, or cache dir). Empty string in memfd mode.
ONELF_MODEmemfd, fuse, tmpfs, cache, or dev
ONELF_ARGV0Original argv[0] before multicall resolution
ONELF_EXECAbsolute path to the packed binary
ONELF_ENTRYPOINTResolved entrypoint name
ONELF_LAUNCH_DIROriginal cwd at launch time

Library and GPU paths (auto-set if applicable)

VariableSet whenPoints to
LD_LIBRARY_PATHlib/ contains .so files<pkg>/lib (prepended)
LIBGL_DRIVERS_PATHlib/dri/ exists<pkg>/lib/dri
LIBVA_DRIVERS_PATHlib/dri/ exists<pkg>/lib/dri
GBM_BACKENDS_PATHlib/gbm/ exists<pkg>/lib/gbm
__EGL_VENDOR_LIBRARY_DIRSshare/glvnd/egl_vendor.d/ existsthat dir
VK_DRIVER_FILESshare/vulkan/icd.d/ has ICD JSONscolon-joined list
LIBDRM_IDS_PATHshare/libdrm/ existsthat dir
LIBDECOR_PLUGIN_DIRshare/libdecor/plugins-1/ existsthat dir
DRIRC_CONFIGDIRshare/drirc.d/ existsthat dir
XDG_DATA_DIRSshare/ exists<pkg>/share (prepended)

Read by the runtime (user-settable)

VariableEffect
ONELF_MODEForce a specific execution mode. On failure the runtime errors instead of falling back.
ONELF_GC_MAX_AGECache GC threshold in days (default 30; 0 disables auto-GC)
XDG_RUNTIME_DIRWhere to create mountpoint dirs (falls back to /tmp)
XDG_CACHE_HOMEWhere the persistent cache mode stores packages (falls back to $HOME/.cache)

Portable directory redirection

When the corresponding file exists next to the packed binary, the runtime points the variable at it and moves the original value to REAL_*:

Sibling fileRedirectsSaved as
<binary>.homeHOMEREAL_HOME
<binary>.configXDG_CONFIG_HOMEREAL_XDG_CONFIG_HOME
<binary>.shareXDG_DATA_HOMEREAL_XDG_DATA_HOME
<binary>.cacheXDG_CACHE_HOMEREAL_XDG_CACHE_HOME

See Portable Directories for the full story.

Build-time (SOURCE_DATE_EPOCH)

Read by onelf pack and onelf build to clamp file mtimes for reproducible output. See Reproducible Builds.

Released under the MIT License.