← 返回命令列表

Linux command

nixos-option 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

nixos-option [option_key]

Example

nixos-option boot.kernelModules

Example

nixos-option users.users.[username].openssh.authorizedKeys.keys

Example

nixos-option nix.buildMachines

Example

NIXOS_CONFIG=[path/to/configuration.nix] nixos-option [option_key]

Example

nixos-option -r users.users.[user]

说明

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.

参数

-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

FAQ

What is the nixos-option command used for?

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.

How do I run a basic nixos-option example?

Run `nixos-option [option_key]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -r, --recursive do in nixos-option?

Show all nested values recursively