Configuration Reference¶
When running the zb command-line interface, zb will gather configuration data from files in the local filesystem. Command-line flags or environment variables will override any settings in the configuration files.
Format¶
zb reads its configuration in JSON With Commas and Comments format. This is a strict superset of JSON that permits:
trailing commas in arrays and objects
C++ style
/* block comments */and// line comments
Location¶
Linux and macOS¶
On Linux and macOS systems, zb follows the XDG Base Directory Specification to find its configuration files. The files used are (in decreasing order of precedence):
$XDG_CONFIG_HOME/zb/config.jwcc. If$XDG_CONFIG_HOMEis not set, it defaults to$HOME/.config.$XDG_CONFIG_HOME/zb/config.json. If$XDG_CONFIG_HOMEis not set, it defaults to$HOME/.config.For each directory in
$XDG_CONFIG_DIRSseparated by colons (defaulting to/etc/xdg): a.zb/config.jwccunderneath the directory b.zb/config.jsonunderneath the directory
Windows¶
On Windows systems, zb will find configuration files at (in decreasing order of precedence):
%AppData%\zb\config.jwcc%AppData%\zb\config.json
Properties¶
- debug¶
Whether to include logging useful for debugging zb itself. This is generally very verbose and should only be enabled if you are reporting an issue with zb. Equivalent to the
--debugcommand-line flag.
- storeDirectory¶
Absolute path to the store directory.
Defaults to:
/opt/zb/storeon Linux and macOSC:\zb\storeon Windows
Will be overridden by
ZB_STORE_DIR.
- storeSocket¶
Absolute path of the store server Unix socket to use or, in the case of
zb serve, to create. The default is:/opt/zb/var/zb/server.sockon Linux and macOSC:\zb\var\zb\server.sockon Windows
Will be overridden by
ZB_STORE_SOCKET.
- cacheDB¶
Absolute path to a SQLite database that contains cache data for speeding up zb. This database can be deleted at any time: it exists purely to speed up builds. The default is:
$XDG_CACHE_HOME/zb/cache.dbon Linux and macOS.$XDG_CACHE_HOMEdefaults to$HOME/.cache.%LocalAppData%\zb\cache.dbon Windows
Equivalent to the
--cachecommand-line flag.
- allowEnvironment¶
The
allowEnvironmentsetting configures the behavior ofos.getenv().If
true, thenos.getenv()can retrieve any environment variable in the zb process’s environment. Equivalent to passing--allow-all-envon the command line.If
false, thenos.getenv()will always returnnil.If the setting is an array, then it is interpreted as a set of environment variable names that
os.getenv()will retrieve from the zb process’s environment.os.getenv()will returnnilfor any environment variable whose name is not in the array. Equivalent to passing--allow-envwith each name on the command line.
allowEnvironmentsettings are not merged: the setting from the file with the highest precedence will be used.
- trustedPublicKeys¶
The
trustedPublicKeyssetting is an array of public keys that zb will trust for existing build results when building a derivation.trustedPublicKeyssettings are merged across all configuration files. Each public key is a JSON object with the following fields:Field
Type
Description
formatstring
Only
"ed25519"is defined at the momentpublicKeystring
Base64-encoded public key data
For more details on the content of these fields, see realization signature specification.
If the configuration files do not include any trusted public keys, then any previous build result can be reused unless the
--cleancommand-line option is passed.