nixos-option(8)

NAME
nixos-option - inspect a NixOS configuration

SYNOPSIS
nixos-option [-r | --recursive] [-I path] [-F | --flake flake-uri]
[--no-flake] [--show-trace] option.name

DESCRIPTION
This command evaluates the configuration specified in NIXOS_CONFIG , nixos-config in NIX_PATH (which by default is /etc/nixos/configuration.nix ), /etc/nixos/flake.nix or the file and attribute specified by the -I or --flake parameter, and returns the properties of the option name given as argument.

When the option name is not an option but an attribute set, the command prints the list of attributes contained in it. When no option name is given, the command prints all top-level attributes in given NixOS configuration.

OPTIONS

-r, --recursive
    Print all the values at or below the specified path recursively.

-I path
    Add an entry to the Nix expression search path. This option is passed to the underlying nix-instantiate(1) invocation.

--show-trace
    Print eval trace. This option is passed to the underlying nix-instantiate(1) invocation.

-F, --flake flake-uri
    Specify the flake containing NixOS configuration. It defaults to /etc/nixos/flake.nix , if the flake exists, it must contain an output named ‘nixosConfigurations.name’ . If name is omitted, it defaults to the current host name.

--no-flake
    Do not imply --flake if /etc/nixos/flake.nix exists. With this option, it is possible to show options in non-flake NixOS configurations even if the current NixOS systems uses flakes.

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
    Type:
      boolean
    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

SEE ALSO
configuration.nix(5)

AUTHORS
-nosplit Nicolas Pierron and the Nixpkgs/NixOS contributors