1 <refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude">
5 <refentrytitle><command>nixos-option</command>
6 </refentrytitle><manvolnum>8</manvolnum>
7 <refmiscinfo class="source">NixOS</refmiscinfo>
8 <!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
11 <refname><command>nixos-option</command></refname>
12 <refpurpose>inspect a NixOS configuration</refpurpose>
16 <command>nixos-option</command>
20 <arg choice='plain'><option>-r</option></arg>
21 <arg choice='plain'><option>--recursive</option></arg>
26 <option>-I</option> <replaceable>path</replaceable>
30 <replaceable>option.name</replaceable>
35 <title>Description</title>
37 This command evaluates the configuration specified in
38 <filename>/etc/nixos/configuration.nix</filename> and returns the properties
39 of the option name given as argument.
42 When the option name is not an option, the command prints the list of
43 attributes contained in the attribute set.
47 <title>Options</title>
49 This command accepts the following options:
53 <term><option>-r</option></term>
54 <term><option>--recursive</option></term>
57 Print all the values at or below the specified path recursively.
63 <option>-I</option> <replaceable>path</replaceable>
67 This option is passed to the underlying
68 <command>nix-instantiate</command> invocation.
75 <title>Environment</title>
79 <envar>NIXOS_CONFIG</envar>
83 Path to the main NixOS configuration module. Defaults to
84 <filename>/etc/nixos/configuration.nix</filename>.
91 <title>Examples</title>
93 Investigate option values:
94 <screen><prompt>$ </prompt>nixos-option boot.loader
95 This attribute set contains:
100 <prompt>$ </prompt>nixos-option boot.loader.grub.enable
108 Whether to enable the GNU GRUB boot loader.
111 "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix"
114 "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix"
121 The author listed in the following section is wrong. If there is any other
122 bug, please report to Nicolas Pierron.
126 <title>See also</title>
129 <refentrytitle>configuration.nix</refentrytitle>
130 <manvolnum>5</manvolnum>