* Revert unintended commit.

svn path=/nixos/trunk/; revision=33958
This commit is contained in:
Eelco Dolstra 2012-04-30 17:47:32 +00:00
parent be189991e0
commit d3ce00bdc3

View File

@ -4,23 +4,6 @@
<title>Installation</title> <title>Installation</title>
<!--===============================================================-->
<section>
<title>Obtaining NixOS</title>
<para>NixOS ISO images can be downloaded from the <link
xlink:href="http://nixos.org/nixos/download.html">NixOS
homepage</link>. These can be burned onto a CD. It is also possible
to copy them onto a USB stick and install NixOS from there. For
details, see the <link
xlink:href="https://nixos.org/wiki/Installing_NixOS_from_a_USB_stick">NixOS
Wiki</link>.</para>
</section>
<!--===============================================================--> <!--===============================================================-->
<section> <section>
@ -38,8 +21,8 @@ Wiki</link>.</para>
<command>ifconfig</command>). Networking is necessary for the <command>ifconfig</command>). Networking is necessary for the
installer, since it will download lots of stuff (such as source installer, since it will download lots of stuff (such as source
tarballs or Nixpkgs channel binaries). Its best if you have a DHCP tarballs or Nixpkgs channel binaries). Its best if you have a DHCP
server on your network. Otherwise configure networking manually server on your network. Otherwise configure
using <command>ifconfig</command>.</para></listitem> manually.</para></listitem>
<listitem><para>The NixOS manual is available on virtual console 8 <listitem><para>The NixOS manual is available on virtual console 8
(press Alt+F8 to access).</para></listitem> (press Alt+F8 to access).</para></listitem>
@ -47,9 +30,6 @@ Wiki</link>.</para>
<listitem><para>Login as <literal>root</literal>, empty <listitem><para>Login as <literal>root</literal>, empty
password.</para></listitem> password.</para></listitem>
<listitem><para>If you downloaded the graphical ISO image, you can
run <command>start xserver</command> to start KDE.</para></listitem>
<listitem><para>The NixOS installer doesnt do any partitioning or <listitem><para>The NixOS installer doesnt do any partitioning or
formatting yet, so you need to that yourself. Use the following formatting yet, so you need to that yourself. Use the following
commands: commands:
@ -59,9 +39,12 @@ Wiki</link>.</para>
<listitem><para>For partitioning: <listitem><para>For partitioning:
<command>fdisk</command>.</para></listitem> <command>fdisk</command>.</para></listitem>
<listitem><para>For initialising Ext4 partitions: <listitem><para>For initialising Ext2/Ext3 partitions:
<command>mkfs.ext4</command>. It is recommended that you assign a <command>mke2fs</command>. Ext3 is recommended; use the
unique symbolic label to the file system using the option <option>-j</option> to create a journalled file system. For
faster access to the Nix store, you may also want to use the
<option>-O dir_index</option>. It is also recommended that you
assign a unique symbolic label to the file system using the option
<option>-L <replaceable>label</replaceable></option>. This will <option>-L <replaceable>label</replaceable></option>. This will
make the file system configuration independent from device make the file system configuration independent from device
changes.</para></listitem> changes.</para></listitem>
@ -79,42 +62,43 @@ $ vgcreate MyVolGroup /dev/sda1 /dev/sdb1
$ lvcreate --size 2G --name bigdisk MyVolGroup $ lvcreate --size 2G --name bigdisk MyVolGroup
$ lvcreate --size 1G --name smalldisk MyVolGroup</screen> $ lvcreate --size 1G --name smalldisk MyVolGroup</screen>
</para></listitem> Possibly youll need to do <userinput>initctl start
lvm</userinput> after this (TODO: check whether this is
needed).</para></listitem>
<listitem><para>For creating software RAID devices, use <listitem><para>For creating software RAID devices:
<command>mdadm</command>.</para></listitem> <command>mdadm</command>.</para></listitem>
</itemizedlist> </itemizedlist>
</para></listitem> </para></listitem>
<listitem><para>Mount the target file system on which NixOS should <listitem><para>Mount the target file system on
be installed on <filename>/mnt</filename>.</para></listitem> <filename>/mnt</filename> on which NixOS would be installed.</para>
</listitem>
<listitem> <listitem>
<para>You now need to create a file <para>Generate a template configuration for the target system:</para>
<filename>/mnt/etc/nixos/configuration.nix</filename> that
specifies the intended configuration of the system. This is <para>The command <command>nixos-option</command> can
because NixOS has a <emphasis>declarative</emphasis> configuration generate an initial configuration file for you, i.e.,
model: you create or edit a description of the configuration that
you want to be built and activated, and then NixOS takes care of
realising that configuration. The command
<command>nixos-option</command> can generate an initial
configuration file for you:
<screen> <screen>
$ nixos-option --install</screen> $ nixos-option --install</screen>
It tries to figure out the kernel modules necessary for mounting It tries to figure out the modules necessary for mounting the root
the root device, as well as various other hardware device, as well as various other hardware characteristics.
characteristics. However, it doesnt try to figure out the However, it doesnt try to figure out the
<option>fileSystems</option> option yet.</para> <option>fileSystems</option> option yet.</para>
<para>You should edit <para>Edit <filename>/mnt/etc/nixos/configuration.nix</filename> to
<filename>/mnt/etc/nixos/configuration.nix</filename> to suit your configure your system. The installation is declarative; you need to
needs. The text editors <command>nano</command> and write a description of the configuration that you want to be built and
<command>vim</command> are available.</para> 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 <para>You need to specify a root file system in
<option>fileSystems</option> and the target device for the Grub boot <option>fileSystems</option> and the target device for the Grub boot
@ -126,12 +110,12 @@ $ nixos-option --install</screen>
<option>boot.initrd.kernelModules</option> all kernel modules that <option>boot.initrd.kernelModules</option> all kernel modules that
are necessary for mounting the root file system, otherwise the are necessary for mounting the root file system, otherwise the
installed system will not be able to boot. (If this happens, boot installed system will not be able to boot. (If this happens, boot
from the CD again, mount the target file system on from CD again, mount the target file system on
<filename>/mnt</filename>, fix <filename>/mnt</filename>, fix
<filename>/mnt/etc/nixos/configuration.nix</filename> and rerun <filename>/mnt/etc/nixos/configuration.nix</filename> and rerun
<filename>nixos-install</filename>.) In most cases, <filename>nixos-install</filename>.)
<command>nixos-option --install</command> will figure out the <command>nixos-hardware-scan</command> should figure out the
required modules.</para></note> required modules in most cases.</para></note>
<para>Examples are available in <para>Examples are available in
<filename>/etc/nixos/nixos/doc/config-examples</filename> and some <filename>/etc/nixos/nixos/doc/config-examples</filename> and some
@ -146,7 +130,6 @@ $ nixos-option --install</screen>
rather, the build actions that it may spawn) may need quite a bit of rather, the build actions that it may spawn) may need quite a bit of
RAM, depending on your configuration.</para></listitem> RAM, depending on your configuration.</para></listitem>
<!--
<listitem><para>Optionally, you can run <listitem><para>Optionally, you can run
<screen> <screen>
@ -154,7 +137,6 @@ $ nixos-checkout</screen>
to make the installer use the latest NixOS/Nixpkgs sources from the to make the installer use the latest NixOS/Nixpkgs sources from the
Subversion repository, rather than the sources on CD.</para></listitem> Subversion repository, rather than the sources on CD.</para></listitem>
-->
<listitem><para>Do the installation: <listitem><para>Do the installation:
@ -177,7 +159,7 @@ $ reboot</screen>
configurations</emphasis> (initially just one). Every time you configurations</emphasis> (initially just one). Every time you
change the NixOS configuration (see <xref change the NixOS configuration (see <xref
linkend="sec-changing-config" />), a new item appears in the menu. linkend="sec-changing-config" />), a new item appears in the menu.
This allows you to easily roll back to another configuration if This allows you to go back easily to another configuration if
something goes wrong.</para> something goes wrong.</para>
<para>You should log in and change the <literal>root</literal> <para>You should log in and change the <literal>root</literal>
@ -210,8 +192,10 @@ $ nix-env -i w3m</screen>
<para><xref linkend="ex-install-sequence" /> shows a typical sequence <para><xref linkend="ex-install-sequence" /> shows a typical sequence
of commands for installing NixOS on an empty hard drive (here of commands for installing NixOS on an empty hard drive (here
<filename>/dev/sda</filename>). <xref linkend="ex-config" /> shows a <filename>/dev/sda). <xref linkend="ex-config" /> shows a
corresponding configuration Nix expression.</para> corresponding configuration Nix expression.</filename>
</para>
<example xml:id='ex-install-sequence'><title>Commands for installing NixOS on <filename>/dev/sda</filename></title> <example xml:id='ex-install-sequence'><title>Commands for installing NixOS on <filename>/dev/sda</filename></title>
<screen> <screen>