OPTNIX-TOML(5)
π NAME π
Okay bestie, this is OPTNIX-TOML(5), the File Formats Manual for optnix.toml β aka the configuration options for optnix. Itβs giving config-options main character energy. π
β¨ DESCRIPTION β¨
This page documents the available configuration keys for the optnix command. No cap, that's the whole vibe.
Configuration files use the TOML format, and they are merged together in this order (if they exist):
- Configuration paths specified on the command line with
--config <FILE> optnix.tomlin the current directory$XDG_CONFIG_HOME/optnix/config.tomlor$HOME/.config/optnix/config.toml/etc/optnix/config.toml
Defaults are noted alongside each option below. π
For more information about the optnix command itself, check the optnix(1) man page.
π¦ TERMINOLOGY π¦
π Option List π
An option list is a JSON-formatted list that has the following schema. Itβs iconic:
{
"name": "services.nginx.enable",
"description": "Whether to enable Nginx Web Server.",
"type": "boolean",
"default": {
"_type": "literalExpression",
"text": "false"
},
"example": {
"_type": "literalExpression",
"text": "true"
},
"loc": ["services", "nginx", "enable"],
"readOnly": false,
"declarations": [
"/nix/store/path/to/nginx/default.nix"
]
}
Generating this list can be done with the optnix flake library, or by using the nixpkgs library function lib.optionAttrSetToDocList.
See the documentation website for information on common configurations and setups to generate option lists. π
π§ Scope π§
A "scope", in its most basic form, consists of four elements:
- Name
- Description
- Option list
- Evaluator
optnix operates on one scope at any given time. It will search the option list for available options, and evaluate options using the "evaluator", which is a small template for a nix eval or nix-instantiate command to run to evaluate a value.
The only elements that are mandatory for a scope are a name and an option list. Periodt π
π OPTIONS π
All available settings and their descriptions. Itβs giving full menu, bestie.
min_scoreβ Minimum score required for fuzzy search matches; the higher the score, the more fuzzy matches are required before it is displayed in the list. Higher scores will generally lead to less (but more relevant) results, but this has diminishing returns. This option is not used in regex search mode. Default:1.debounce_timeβ Debounce time for search, in milliseconds. Default:25.default_scopeβ Default scope to use if not specified on the command line. Default:(none).formatter_cmdβ Formatter command to use for evaluated values, if available. Takes input on stdin and outputs the formatted code back to stdout. Default:nixfmt.scopes.<name>β Scopes, specified as a map. Each scope will have a unique name. Default:{}(none).scopes.<name>.descriptionβ A small description of what the purpose of this scope is. Optional, but useful for command-line completion and listing scopes more descriptively. Default:(none).scopes.<name>.options-list-fileβ A JSON file containing an option list. This is preferred overscopes.<name>.options-list-cmdif it exists. Default:(none).scopes.<name>.options-list-cmdβ A command to evaluate that produces a JSON-formatted option list on stdout. This is a fallback ifscopes.<name>.options-list-filedoes not exist or fails. Default:(none).scopes.<name>.evaluatorβ A command template that can be used to evaluate a Nix configuration to retrieve values. Requires a single placeholder called{{ .Option }}to be present; this is filled in with the option to evaluate automatically. Default:(none).
π SEE ALSO π
optnix(1)β bestie, go read it π
π AUTHORS π
Maintained by the optnix authors. See the main man page optnix(1) for details.
Thatβs the whole page, bestie π«Ά β this is from the OPTNIX-TOML(5) File Formats Manual and itβs dated 1980-01-01. Obsessed. Mwah π
π¦ where this page comes from
- nixos 26.05: optnix 0.3.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms