Re-word installation, and use "nixos-option --install" to generate a

template for configuration.nix which uses the result of
nixos-hardware-scan.

svn path=/nixos/trunk/; revision=23926
This commit is contained in:
Nicolas Pierron 2010-09-25 22:30:02 +00:00
parent 93029d3c4f
commit 26417566c4

View File

@ -133,39 +133,32 @@ $ lvcreate --size 1G --name smalldisk MyVolGroup</screen>
<listitem>
<para>The installation is declarative; you need to write a
description of the configuration that you want to be built and
activated. The configuration is specified in a Nix expression and
must be stored <emphasis>on the target file system</emphasis> in
<filename>/mnt/etc/nixos/configuration.nix</filename>. See
<filename>/etc/nixos/nixos/doc/config-examples</filename> for
example machine configurations. You can copy and edit one of
those (e.g., copy
<filename>/etc/nixos/nixos/doc/config-examples/basic.nix</filename>
to <filename>/mnt/etc/nixos/configuration.nix</filename>). See
<xref linkend="ch-options"/> for a list of the available
configuration options. The text editors <command>nano</command>
and <command>vim</command> are available.</para>
<para>Generate a template configuration for the target system:</para>
<para>In particular you need to specify a root file system in
<option>fileSystems</option> and the target device for the Grub
boot loader in <option>boot.grubDevice</option>.</para>
<para>The command <command>nixos-hardware-scan</command> can
<para>The command <command>nixos-option</command> can
generate an initial configuration file for you, i.e.,
<screen>
$ mkdir -p /mnt/etc/nixos
$ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix</screen>
$ nixos-option --install</screen>
It tries to figure out the modules necessary for mounting the root
device, as well as various other hardware characteristics.
However, it doesnt try to figure out the
<option>fileSystems</option> option yet.</para>
<para>More examples of NixOS configurations for some actual
machines can be found at <link
xlink:href="https://svn.nixos.org/repos/nix/configurations/trunk/"/>.</para>
<para>Edit <filename>/mnt/etc/nixos/configuration.nix</filename> to
configure your system. The installation is declarative; you need to
write a description of the configuration that you want to be built and
activated. The configuration is specified in a Nix expression and must
be stored <emphasis>on the target file system</emphasis>. The text
editors <command>nano</command> and <command>vim</command> are
available.</para>
<para>You need to specify a root file system in
<option>fileSystems</option> and the target device for the Grub boot
loader in <option>boot.grubDevice</option>. See
<xref linkend="ch-options"/> for a list of the available configuration
options.</para>
<note><para>It is very important that you specify in the option
<option>boot.initrd.kernelModules</option> all kernel modules that
@ -178,6 +171,11 @@ $ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix</screen>
<command>nixos-hardware-scan</command> should figure out the
required modules in most cases.</para></note>
<para>Examples are available in
<filename>/etc/nixos/nixos/doc/config-examples</filename> and some
actual NixOS configuration can be found at <link
xlink:href="https://svn.nixos.org/repos/nix/configurations/trunk/"/>.</para>
</listitem>
<listitem><para>If your machine has a limited amount of memory, you
@ -259,8 +257,7 @@ $ fdisk /dev/sda <lineannotation>(or whatever device you want to install on)</li
$ mke2fs -j -L nixos /dev/sda1 <lineannotation>(idem)</lineannotation>
$ mkswap -L swap /dev/sda2 <lineannotation>(idem)</lineannotation>
$ mount LABEL=nixos /mnt
$ mkdir -p /mnt/etc/nixos
$ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix
$ nixos-option --install
$ nano /mnt/etc/nixos/configuration.nix
<lineannotation>(in particular, set the fileSystems and swapDevices options)</lineannotation>
$ nixos-install