OPTNIX-TOML(5)

πŸ“¦
version 0.3.2 Β· 2 versions
, in nixos 26.05

πŸŽ€ 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.toml in the current directory
  • $XDG_CONFIG_HOME/optnix/config.toml or $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 over scopes.<name>.options-list-cmd if 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 if scopes.<name>.options-list-file does 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