nixos-option - Man Page
inspect a NixOS configuration
Examples (TL;DR)
- List all subkeys of a given option key:
nixos-option option_key
- List current boot kernel modules:
nixos-option boot.kernelModules
- List authorized keys for a specific user:
nixos-option users.users.username.openssh.authorizedKeys.keyFiles|keys
- List all remote builders:
nixos-option nix.buildMachines
- List all subkeys of a given key on another NixOS configuration:
NIXOS_CONFIG=path_to_configuration.nix nixos-option option_key
- Show recursively all values of a user:
nixos-option -r users.users.user
Synopsis
nixos-option [{-r | --recursive}] [-I path] [option.name]
Description
This command evaluates the configuration specified in /etc/nixos/configuration.nix and returns the properties of the option name given as argument.
When the option name is not an option, the command prints the list of attributes contained in the attribute set.
Options
This command accepts the following options:
- -r, --recursive
Print all the values at or below the specified path recursively.
- -I path
This option is passed to the underlying nix-instantiate invocation.
Environment
- NIXOS_CONFIG
Path to the main NixOS configuration module. Defaults to /etc/nixos/configuration.nix.
Examples
Investigate option values:
$ nixos-option boot.loader This attribute set contains: generationsDir grub initScript $ nixos-option boot.loader.grub.enable Value: true Default: true Description: Whether to enable the GNU GRUB boot loader. Declared by: "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix" Defined by: "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix"
Bugs
The author listed in the following section is wrong. If there is any other bug, please report to Nicolas Pierron.
See Also
Author
Eelco Dolstra
Author
Copyright
Copyright © 2007-2020 Eelco Dolstra