nixos-option
Display information about NixOS configuration options
TLDR
List all subkeys of a given option key
List current boot kernel modules
List authorized keys for a specific user
List all remote builders
List all subkeys of a given key on another NixOS configuration
Show recursively all values of a user
SYNOPSIS
nixos-option [options] [option-name]
PARAMETERS
--help
Displays help text.
--version
Shows the version number.
-j
Use
--eval-cache
Enable the Nix expression evaluation cache. Can improve performance for repeated lookups.
--read-only-mode
Do not allow option value setting. This option prevents accidental modifications during inspection.
[option-name]
The specific option to query. If omitted, all options are displayed.
DESCRIPTION
The `nixos-option` command provides a way to browse and query configuration options within the NixOS operating system. It allows users to discover available settings, understand their purpose, and view their default values. This is crucial for customizing NixOS systems to meet specific needs. The command retrieves information from the NixOS option definitions, often located within the Nixpkgs repository. It displays the option name, type, default value, description, and any relevant documentation. This helps administrators understand how to configure services, hardware, and other system aspects managed through NixOS's declarative configuration system. Users can filter options by name or type using various flags, making it easier to find the desired configuration setting. The command's output is formatted for readability, enhancing the user experience when exploring NixOS configuration possibilities.
OUTPUT FORMATTING
The output is generally formatted for easy reading in a terminal. It typically includes the option name, type, default value, and a detailed description. The display can be influenced by command-line arguments.
USAGE EXAMPLES
Example:
`nixos-option services.openssh.enable`
Shows the details of the `services.openssh.enable` option.
Example:
`nixos-option`
Lists all available options (potentially very long).
Example:
`nixos-option services.openssh | less`
Lists information related to options under 'services.openssh', and pipes the output to 'less'.
NIX EXPRESSION EVALUATION
Behind the scenes, `nixos-option` evaluates Nix expressions to determine the current values and descriptions of the options. This evaluation process is handled by the Nix package manager itself.