LinuxCommandLibrary

nixos-option

inspects NixOS configuration values, showing what options are set and their

TLDR

List all subkeys of a given option key

$ nixos-option [option_key]
copy
List current boot kernel modules
$ nixos-option boot.kernelModules
copy
List authorized keys for a specific user
$ nixos-option users.users.[username].openssh.authorizedKeys.keys
copy
List all remote builders
$ nixos-option nix.buildMachines
copy
List subkeys on another NixOS configuration
$ NIXOS_CONFIG=[path/to/configuration.nix] nixos-option [option_key]
copy
Show recursively all values of a user
$ nixos-option -r users.users.[user]
copy

SYNOPSIS

nixos-option [options] optionpath_

DESCRIPTION

nixos-option inspects NixOS configuration values, showing what options are set and their current values. It navigates the hierarchical NixOS module system using dot notation (e.g., services.nginx.enable).
The tool displays the type, default value, description, and current value of configuration options. For container options (like services.* or users.*), it lists available subkeys.
This is useful for exploring available NixOS options, debugging configuration issues, and understanding the current system state as defined by the Nix configuration.

PARAMETERS

-r, --recursive

Show all nested values recursively
_option_path_
Dot-separated path to the configuration option
NIXOS_CONFIG
Environment variable to specify an alternative configuration file

CAVEATS

Evaluates the Nix configuration, which can take time on complex systems. Only shows options from the NixOS module system; arbitrary Nix expressions are not inspectable. Some dynamic options may not be fully discoverable.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community