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">
4
5<refmeta>
6 <refentrytitle><command>nixos-option</command></refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">NixOS</refmiscinfo>
9 <!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
10</refmeta>
11
12<refnamediv>
13 <refname><command>nixos-option</command></refname>
14 <refpurpose>inspect a NixOS configuration</refpurpose>
15</refnamediv>
16
17<refsynopsisdiv>
18 <cmdsynopsis>
19 <command>nixos-option</command>
20 <arg>
21 <option>-I</option>
22 <replaceable>path</replaceable>
23 </arg>
24 <arg><option>--verbose</option></arg>
25 <arg><option>--xml</option></arg>
26 <arg choice="plain"><replaceable>option.name</replaceable></arg>
27 </cmdsynopsis>
28</refsynopsisdiv>
29
30<refsection><title>Description</title>
31
32<para>This command evaluates the configuration specified in
33<filename>/etc/nixos/configuration.nix</filename> and returns the properties
34of the option name given as argument.</para>
35
36<para>When the option name is not an option, the command prints the list of
37attributes contained in the attribute set.</para>
38
39</refsection>
40
41<refsection><title>Options</title>
42
43<para>This command accepts the following options:</para>
44
45<variablelist>
46
47 <varlistentry>
48 <term><option>-I</option> <replaceable>path</replaceable></term>
49 <listitem>
50 <para>
51 This option is passed to the underlying
52 <command>nix-instantiate</command> invocation.
53 </para>
54 </listitem>
55 </varlistentry>
56
57 <varlistentry>
58 <term><option>--verbose</option></term>
59 <listitem>
60 <para>
61 This option enables verbose mode, which currently is just
62 the Bash <command>set</command> <option>-x</option> debug mode.
63 </para>
64 </listitem>
65 </varlistentry>
66
67 <varlistentry>
68 <term><option>--xml</option></term>
69 <listitem>
70 <para>
71 This option causes the output to be rendered as XML.
72 </para>
73 </listitem>
74 </varlistentry>
75
76</variablelist>
77
78</refsection>
79
80<refsection><title>Environment</title>
81
82<variablelist>
83
84 <varlistentry>
85 <term><envar>NIXOS_CONFIG</envar></term>
86 <listitem>
87 <para>Path to the main NixOS configuration module. Defaults to
88 <filename>/etc/nixos/configuration.nix</filename>.</para>
89 </listitem>
90 </varlistentry>
91
92</variablelist>
93
94</refsection>
95
96
97<refsection><title>Examples</title>
98
99<para>Investigate option values:
100
101<screen>$ nixos-option boot.loader
102This attribute set contains:
103generationsDir
104grub
105initScript
106
107$ nixos-option boot.loader.grub.enable
108Value:
109true
110
111Default:
112true
113
114Description:
115Whether to enable the GNU GRUB boot loader.
116
117Declared by:
118 "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix"
119
120Defined by:
121 "/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs/nixos/modules/system/boot/loader/grub/grub.nix"
122</screen></para>
123
124</refsection>
125
126<refsection><title>Bugs</title>
127
128<para>The author listed in the following section is wrong. If there is any
129 other bug, please report to Nicolas Pierron.</para>
130
131</refsection>
132
133
134</refentry>