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:
parent
93029d3c4f
commit
26417566c4
@ -133,39 +133,32 @@ $ lvcreate --size 1G --name smalldisk MyVolGroup</screen>
|
|||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
|
|
||||||
<para>The installation is declarative; you need to write a
|
<para>Generate a template configuration for the target system:</para>
|
||||||
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>In particular you need to specify a root file system in
|
<para>The command <command>nixos-option</command> can
|
||||||
<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
|
|
||||||
generate an initial configuration file for you, i.e.,
|
generate an initial configuration file for you, i.e.,
|
||||||
|
|
||||||
<screen>
|
<screen>
|
||||||
$ mkdir -p /mnt/etc/nixos
|
$ nixos-option --install</screen>
|
||||||
$ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix</screen>
|
|
||||||
|
|
||||||
It tries to figure out the modules necessary for mounting the root
|
It tries to figure out the modules necessary for mounting the root
|
||||||
device, as well as various other hardware characteristics.
|
device, as well as various other hardware characteristics.
|
||||||
However, it doesn’t try to figure out the
|
However, it doesn’t try to figure out the
|
||||||
<option>fileSystems</option> option yet.</para>
|
<option>fileSystems</option> option yet.</para>
|
||||||
|
|
||||||
<para>More examples of NixOS configurations for some actual
|
<para>Edit <filename>/mnt/etc/nixos/configuration.nix</filename> to
|
||||||
machines can be found at <link
|
configure your system. The installation is declarative; you need to
|
||||||
xlink:href="https://svn.nixos.org/repos/nix/configurations/trunk/"/>.</para>
|
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
|
<note><para>It is very important that you specify in the option
|
||||||
<option>boot.initrd.kernelModules</option> all kernel modules that
|
<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
|
<command>nixos-hardware-scan</command> should figure out the
|
||||||
required modules in most cases.</para></note>
|
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>
|
||||||
|
|
||||||
<listitem><para>If your machine has a limited amount of memory, you
|
<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>
|
$ mke2fs -j -L nixos /dev/sda1 <lineannotation>(idem)</lineannotation>
|
||||||
$ mkswap -L swap /dev/sda2 <lineannotation>(idem)</lineannotation>
|
$ mkswap -L swap /dev/sda2 <lineannotation>(idem)</lineannotation>
|
||||||
$ mount LABEL=nixos /mnt
|
$ mount LABEL=nixos /mnt
|
||||||
$ mkdir -p /mnt/etc/nixos
|
$ nixos-option --install
|
||||||
$ nixos-hardware-scan > /mnt/etc/nixos/configuration.nix
|
|
||||||
$ nano /mnt/etc/nixos/configuration.nix
|
$ nano /mnt/etc/nixos/configuration.nix
|
||||||
<lineannotation>(in particular, set the fileSystems and swapDevices options)</lineannotation>
|
<lineannotation>(in particular, set the fileSystems and swapDevices options)</lineannotation>
|
||||||
$ nixos-install
|
$ nixos-install
|
||||||
|
Loading…
x
Reference in New Issue
Block a user