summary refs log tree commit diff
path: root/nixos/doc/manual/man-nixos-option.xml
blob: b921386d0df01515a5da27385608bc072940901b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<refentry xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude">
 <refmeta>
  <refentrytitle><command>nixos-option</command>
  </refentrytitle><manvolnum>8</manvolnum>
  <refmiscinfo class="source">NixOS</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
 </refmeta>
 <refnamediv>
  <refname><command>nixos-option</command></refname>
  <refpurpose>inspect a NixOS configuration</refpurpose>
 </refnamediv>
 <refsynopsisdiv>
  <cmdsynopsis>
   <command>nixos-option</command>

   <arg>
    <group choice='req'>
     <arg choice='plain'><option>-r</option></arg>
     <arg choice='plain'><option>--recursive</option></arg>
    </group>
   </arg>

   <arg>
    <option>-I</option> <replaceable>path</replaceable>
   </arg>

   <arg>
    <replaceable>option.name</replaceable>
   </arg>
  </cmdsynopsis>
 </refsynopsisdiv>
 <refsection>
  <title>Description</title>
  <para>
   This command evaluates the configuration specified in
   <filename>/etc/nixos/configuration.nix</filename> and returns the properties
   of the option name given as argument.
  </para>
  <para>
   When the option name is not an option, the command prints the list of
   attributes contained in the attribute set.
  </para>
 </refsection>
 <refsection>
  <title>Options</title>
  <para>
   This command accepts the following options:
  </para>
  <variablelist>
   <varlistentry>
    <term><option>-r</option></term>
    <term><option>--recursive</option></term>
    <listitem>
     <para>
      Print all the values at or below the specified path recursively.
     </para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>
     <option>-I</option> <replaceable>path</replaceable>
    </term>
    <listitem>
     <para>
      This option is passed to the underlying
      <command>nix-instantiate</command> invocation.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsection>
 <refsection>
  <title>Environment</title>
  <variablelist>
   <varlistentry>
    <term>
     <envar>NIXOS_CONFIG</envar>
    </term>
    <listitem>
     <para>
      Path to the main NixOS configuration module. Defaults to
      <filename>/etc/nixos/configuration.nix</filename>.
     </para>
    </listitem>
   </varlistentry>
  </variablelist>
 </refsection>
 <refsection>
  <title>Examples</title>
  <para>
   Investigate option values:
<screen><prompt>$ </prompt>nixos-option boot.loader
This attribute set contains:
generationsDir
grub
initScript

<prompt>$ </prompt>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"
</screen>
  </para>
 </refsection>
 <refsection>
  <title>Bugs</title>
  <para>
   The author listed in the following section is wrong. If there is any other
   bug, please report to Nicolas Pierron.
  </para>
 </refsection>
 <refsection>
  <title>See also</title>
  <para>
   <citerefentry>
    <refentrytitle>configuration.nix</refentrytitle>
    <manvolnum>5</manvolnum>
   </citerefentry>
  </para>
 </refsection>
</refentry>