Expand description
Per-app lumen.toml configuration model.
Per-app lumen.toml config loader.
- Reads an optional file at
<app-dir>/lumen.toml. - Sets runtime defaults; CLI flags supplied on top take precedence.
- Unknown top-level keys are rejected; section fields default when absent.
[app]
entry = "main.lmn" # default
locale = "de-DE" # default: the OS locale, else en-US
fallback_locale = "de-DE" # default: en-US; the language the source strings are in
single_instance = true # default: false; second launch forwards argv and exits
[window]
title = "My App" # default: app directory name
size = [1280, 720] # default: [960, 720]
[skin]
name = "default" # default: none (bare framework)
[mcp]
port = 7878 # default when absent; 0 disables the server
[profile]
mode = "off" # off | chrome | tracy | stderr
[asset_roots]
paths = ["icons", "../shared"] # extra dirs scanned for relative src=
[dependencies] # runtime modules + portable plugins, sorted-name order
lumen-audio = { bundled = true }
shape-tools = { path = "modules/shape-tools", config = { units = "mm" } }
weather-feed = "1.2" # registry package, fetched by lpm and pinned in lumen.lock
[target.web.dependencies] # laid over [dependencies] for a `lumenc web` build
chart = { path = "modules/chart" } # a module with only a web half: chart/web/lumen-addon.toml
[[hooks]] # project build/setup commands; see `crate::hooks`
when = "prebuild" # "prebuild" | "prerun"
os = "linux" # optional: "linux" | "macos" | "windows"
run = "mkdir -p lib && cc -shared -fPIC -O2 -o lib/libmd.so md.c"
inputs = ["md.c"]
outputs = ["lib/libmd.so"]
[[plugins]] # compiler plugins, run in declaration order
name = "markdown" # must match what the cdylib reports
path = "plugins/markdown" # built cdylib; extensionless probes lib*.so/.dylib/.dll
config = { flavor = "gfm" } # optional, handed to the plugin verbatimParse failures surface as ConfigError; the caller decides whether to abort or fall back to defaults.
Structs§
- AppCfg
[app]block.- Asset
Roots Cfg [asset_roots]block.- Bundle
Capabilities - The resolved per-app capability set for a static
--bundle, produced by merging explicit[capabilities]/[runtime]config with a conservative source scan, then mapped to the cargo--featureslist the trimmed runtime seam is built with. - Capabilities
Cfg [capabilities]block: which optional subsystems a build of this app carries, keyed by capability name (os-tray,http-fetch,mcp, …).- HookCfg
- One
[[hooks]]entry: an app-declared build/setup command. - Lumen
Toml - Parsed
lumen.tomlconfig, all fields optional. - McpCfg
[mcp]block.- Pages
Cfg [pages]block - file-based multi-page navigation.- PerfCfg
[perf]block carrying per-cache memory caps.- Profile
Cfg [profile]block.- Render
Cfg [render]block: which render backend draws the app.- Runtime
Cfg [runtime]block - per-app overrides for the startup subsystem-gating (measured startup quick-wins). Every field isOption:Nonekeeps the automatic behaviour (run-mode gating for MCP / hot-reload;min(cores, 4)for threads), whileSome(v)forces it.- Script
Cfg [script]block - an override that forces every script in the app onto one language. Without it each script file belongs to the language its extension names, as the installed host modules declare it, and an app that ships more than one language runs one host per language. Setenginewhen the per-file answer is not the one you want, most often because the app keeps its script inline in the markup, where there is no extension to read.- Signals
Cfg [signals]table - typed signal schema for thelumenc lint --signalsmode. Each entry maps a signal name to its expectedSignalType. Authors hand-write this; the lint subcommand uses it to flag untyped writes and schema mismatches.- SkinCfg
[skin]block.- WebCfg
[web]block - howlumenc webemits the app as a static site.- WebPage
Cfg [web.pages.<key>]block - what one page says about itself.- WebSsr
Cfg [web.ssr]block - what the app allows a render to reach.- Window
Cfg [window]block.
Enums§
- Config
Error - Errors returned by
LumenToml::load_or_default. - HookOs
[[hooks]]osvalue: restricts a hook to one platform, matched againststd::env::consts::OS("linux","macos","windows").- Hook
When [[hooks]]whenvalue: the trigger point a hook fires at.- Render
Backend Choice - The value of
[render] backend. - Signal
Type - Declared signal type for a
SignalsCfgentry. - WebCss
Mode [web] css- how a page’s styling reaches the browser.- WebHost
[web] host- where the site is deployed, and so which rewrite file lets a deep path reach the app.- WebMenubar
[web] menubar- what an app menu bar becomes in a document.- WebNavigation
[web] navigation- how a link to another page of the same site is followed.- WebPrerender
[web] prerender- where the state a page is rendered with comes from.- WebRender
[web] render- where a page’s document comes from.- WebSeed
Value - One
[web.seed]value. - WebWidgets
[web] widgets- which shape a composed widget is emitted as.
Functions§
- app_
sources - The app’s markup, scripts, styles and config read into one haystack, for a build that asks whether the app uses a subsystem. Bounded, so a large asset tree cannot turn the question into a slow directory crawl.