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