···1-<section 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- version="5.0"
5- xml:id="sec-uefi-installation">
6-7-<title>UEFI Installation</title>
8-9-<para>NixOS can also be installed on UEFI systems. The procedure
10-is by and large the same as a BIOS installation, with the following
11-changes:
12-13-<itemizedlist>
14- <listitem>
15- <para>You should boot the live CD in UEFI mode (consult your
16- specific hardware's documentation for instructions). You may find
17- the <link
18- xlink:href="http://www.rodsbooks.com/refind">rEFInd
19- boot manager</link> useful.</para>
20- </listitem>
21- <listitem>
22- <para>Instead of <command>fdisk</command>, you should use
23- <command>gdisk</command> to partition your disks. You will need to
24- have a separate partition for <filename>/boot</filename> with
25- partition code EF00, and it should be formatted as a
26- <literal>vfat</literal> filesystem.</para>
27- </listitem>
28- <listitem>
29- <para>Instead of <option>boot.loader.grub.device</option>,
30- you must set <option>boot.loader.systemd-boot.enable</option> to
31- <literal>true</literal>. <command>nixos-generate-config</command>
32- should do this automatically for new configurations when booted in
33- UEFI mode.</para>
34- </listitem>
35- <listitem>
36- <para>After having mounted your installation partition to
37- <code>/mnt</code>, you must mount the <code>boot</code> partition
38- to <code>/mnt/boot</code>.</para>
39- </listitem>
40- <listitem>
41- <para>You may want to look at the options starting with
42- <option>boot.loader.efi</option> and <option>boot.loader.systemd-boot</option>
43- as well.</para>
44- </listitem>
45-</itemizedlist>
46-</para>
47-48-</section>
···67<title>Installing NixOS</title>
80009<orderedlist>
1011- <listitem><para>Boot from the CD.</para></listitem>
0000001213 <listitem><para>The CD contains a basic NixOS installation. (It
14 also contains Memtest86+, useful if you want to test new hardware).
···50 <itemizedlist>
5152 <listitem><para>For partitioning:
53- <command>fdisk</command>.</para></listitem>
0000000000000000000000005455 <listitem><para>For initialising Ext4 partitions:
56 <command>mkfs.ext4</command>. It is recommended that you assign a
···67 <listitem><para>For creating swap partitions:
68 <command>mkswap</command>. Again it’s recommended to assign a
69 label to the swap partition: <option>-L
70- <replaceable>label</replaceable></option>.</para></listitem>
0000000000000000007172 <listitem><para>For creating LVM volumes, the LVM commands, e.g.,
73···9596 </para></listitem>
970000000000098 <listitem><para>If your machine has a limited amount of memory, you
99 may want to activate swap devices now (<command>swapon
100 <replaceable>device</replaceable></command>). The installer (or
101 rather, the build actions that it may spawn) may need quite a bit of
102- RAM, depending on your configuration.</para></listitem>
00000103104 <listitem>
105···135 install Emacs by running <literal>nix-env -i
136 emacs</literal>.</para>
137138- <para>You <emphasis>must</emphasis> set the option
000139 <option>boot.loader.grub.device</option> to specify on which disk
140 the GRUB boot loader is to be installed. Without it, NixOS cannot
141- boot.</para>
000000000000142143 <para>If there are other operating systems running on the machine before
144 installing NixOS, the
···247<example xml:id='ex-install-sequence'><title>Commands for Installing NixOS on <filename>/dev/sda</filename></title>
248<screen>
249# fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation>
0000000000000000000000250# mkfs.ext4 -L nixos /dev/sda1
251# mkswap -L swap /dev/sda2
252# swapon /dev/sda2
0253# mount /dev/disk/by-label/nixos /mnt
0254# nixos-generate-config --root /mnt
255# nano /mnt/etc/nixos/configuration.nix
256# nixos-install
···267 ./hardware-configuration.nix
268 ];
269270- boot.loader.grub.device = "/dev/sda";
0271272 # Note: setting fileSystems is generally not
273 # necessary, since nixos-generate-config figures them out
···279}</screen>
280</example>
281282-<xi:include href="installing-uefi.xml" />
283<xi:include href="installing-usb.xml" />
284<xi:include href="installing-pxe.xml" />
285<xi:include href="installing-virtualbox-guest.xml" />
···67<title>Installing NixOS</title>
89+<para>NixOS can be installed on BIOS or UEFI systems. The procedure
10+for a UEFI installation is by and large the same as a BIOS installation. The differences are mentioned in the steps that follow.</para>
11+12<orderedlist>
1314+ <listitem><para>Boot from the CD.</para>
15+ <variablelist>
16+ <varlistentry><term>UEFI systems</term>
17+ <listitem><para>You should boot the live CD in UEFI mode
18+ (consult your specific hardware's documentation for instructions).
19+ You may find the <link xlink:href="http://www.rodsbooks.com/refind">rEFInd boot
20+ manager</link> useful.</para></listitem></varlistentry></variablelist></listitem>
2122 <listitem><para>The CD contains a basic NixOS installation. (It
23 also contains Memtest86+, useful if you want to test new hardware).
···59 <itemizedlist>
6061 <listitem><para>For partitioning:
62+ <command>fdisk</command>.
63+<screen>
64+# fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation>
65+-- for UEFI systems only
66+> n # <lineannotation>(create a new partition for /boot)</lineannotation>
67+> 3 # <lineannotation>(make it a partition number 3)</lineannotation>
68+> # <lineannotation>(press enter to accept the default)</lineannotation>
69+> +512M # <lineannotation>(the size of the UEFI boot partition)</lineannotation>
70+> t # <lineannotation>(change the partition type ...)</lineannotation>
71+> 3 # <lineannotation>(... of the boot partition ...)</lineannotation>
72+> 1 # <lineannotation>(... to 'UEFI System')</lineannotation>
73+-- for BIOS or UEFI systems
74+> n # <lineannotation>(create a new partition for /swap)</lineannotation>
75+> 2 # <lineannotation>(make it a partition number 2)</lineannotation>
76+> # <lineannotation>(press enter to accept the default)</lineannotation>
77+> +8G # <lineannotation>(the size of the swap partition, set to whatever you like)</lineannotation>
78+> n # <lineannotation>(create a new partition for /)</lineannotation>
79+> 1 # <lineannotation>(make it a partition number 1)</lineannotation>
80+> # <lineannotation>(press enter to accept the default)</lineannotation>
81+> # <lineannotation>(press enter to accept the default and use the rest of the remaining space)</lineannotation>
82+> a # <lineannotation>(make the partition bootable)</lineannotation>
83+> x # <lineannotation>(enter expert mode)</lineannotation>
84+> f # <lineannotation>(fix up the partition ordering)</lineannotation>
85+> r # <lineannotation>(exit expert mode)</lineannotation>
86+> w # <lineannotation>(write the partition table to disk and exit)</lineannotation></screen></para></listitem>
8788 <listitem><para>For initialising Ext4 partitions:
89 <command>mkfs.ext4</command>. It is recommended that you assign a
···100 <listitem><para>For creating swap partitions:
101 <command>mkswap</command>. Again it’s recommended to assign a
102 label to the swap partition: <option>-L
103+ <replaceable>label</replaceable></option>. For example:
104+105+<screen>
106+# mkswap -L swap /dev/sda2</screen>
107+108+ </para></listitem>
109+110+ <listitem>
111+ <variablelist>
112+ <varlistentry><term>UEFI systems</term>
113+ <listitem><para>For creating boot partitions:
114+ <command>mkfs.fat</command>. Again it’s recommended to assign a
115+ label to the boot partition: <option>-L
116+ <replaceable>label</replaceable></option>. For example:
117+118+<screen>
119+# mkfs.fat -F 32 -L boot /dev/sda3</screen>
120+121+ </para></listitem></varlistentry></variablelist></listitem>
122123 <listitem><para>For creating LVM volumes, the LVM commands, e.g.,
124···146147 </para></listitem>
148149+ <listitem>
150+ <variablelist>
151+ <varlistentry><term>UEFI systems</term>
152+ <listitem><para>Mount the boot file system on <filename>/mnt/boot</filename>, e.g.
153+154+<screen>
155+# mount /dev/disk/by-label/boot /mnt/boot
156+</screen>
157+158+ </para></listitem></varlistentry></variablelist></listitem>
159+160 <listitem><para>If your machine has a limited amount of memory, you
161 may want to activate swap devices now (<command>swapon
162 <replaceable>device</replaceable></command>). The installer (or
163 rather, the build actions that it may spawn) may need quite a bit of
164+ RAM, depending on your configuration.
165+166+<screen>
167+# swapon /dev/sda2</screen>
168+169+ </para></listitem>
170171 <listitem>
172···202 install Emacs by running <literal>nix-env -i
203 emacs</literal>.</para>
204205+ <variablelist>
206+207+ <varlistentry><term>BIOS systems</term>
208+ <listitem><para>You <emphasis>must</emphasis> set the option
209 <option>boot.loader.grub.device</option> to specify on which disk
210 the GRUB boot loader is to be installed. Without it, NixOS cannot
211+ boot.</para></listitem></varlistentry>
212+213+ <varlistentry><term>UEFI systems</term>
214+ <listitem><para>You <emphasis>must</emphasis> set the option
215+ <option>boot.loader.systemd-boot.enable</option> to <literal>true</literal>.
216+ <command>nixos-generate-config</command> should do this automatically for new
217+ configurations when booted in
218+ UEFI mode.</para>
219+ <para>You may want to look at the options starting with
220+ <option>boot.loader.efi</option> and <option>boot.loader.systemd-boot</option>
221+ as well.</para></listitem></varlistentry>
222+223+ </variablelist>
224225 <para>If there are other operating systems running on the machine before
226 installing NixOS, the
···329<example xml:id='ex-install-sequence'><title>Commands for Installing NixOS on <filename>/dev/sda</filename></title>
330<screen>
331# fdisk /dev/sda # <lineannotation>(or whatever device you want to install on)</lineannotation>
332+-- for UEFI systems only
333+> n # <lineannotation>(create a new partition for /boot)</lineannotation>
334+> 3 # <lineannotation>(make it a partition number 3)</lineannotation>
335+> # <lineannotation>(press enter to accept the default)</lineannotation>
336+> +512M # <lineannotation>(the size of the UEFI boot partition)</lineannotation>
337+> t # <lineannotation>(change the partition type ...)</lineannotation>
338+> 3 # <lineannotation>(... of the boot partition ...)</lineannotation>
339+> 1 # <lineannotation>(... to 'UEFI System')</lineannotation>
340+-- for BIOS or UEFI systems
341+> n # <lineannotation>(create a new partition for /swap)</lineannotation>
342+> 2 # <lineannotation>(make it a partition number 2)</lineannotation>
343+> # <lineannotation>(press enter to accept the default)</lineannotation>
344+> +8G # <lineannotation>(the size of the swap partition)</lineannotation>
345+> n # <lineannotation>(create a new partition for /)</lineannotation>
346+> 1 # <lineannotation>(make it a partition number 1)</lineannotation>
347+> # <lineannotation>(press enter to accept the default)</lineannotation>
348+> # <lineannotation>(press enter to accept the default and use the rest of the remaining space)</lineannotation>
349+> a # <lineannotation>(make the partition bootable)</lineannotation>
350+> x # <lineannotation>(enter expert mode)</lineannotation>
351+> f # <lineannotation>(fix up the partition ordering)</lineannotation>
352+> r # <lineannotation>(exit expert mode)</lineannotation>
353+> w # <lineannotation>(write the partition table to disk and exit)</lineannotation>
354# mkfs.ext4 -L nixos /dev/sda1
355# mkswap -L swap /dev/sda2
356# swapon /dev/sda2
357+# mkfs.fat -F 32 -L boot /dev/sda3 # <lineannotation>(for UEFI systems only)</lineannotation>
358# mount /dev/disk/by-label/nixos /mnt
359+# mount /dev/disk/by-label/boot /mnt/boot # <lineannotation>(for UEFI systems only)</lineannotation>
360# nixos-generate-config --root /mnt
361# nano /mnt/etc/nixos/configuration.nix
362# nixos-install
···373 ./hardware-configuration.nix
374 ];
375376+ boot.loader.grub.device = "/dev/sda"; # <lineannotation>(for BIOS systems only)</lineannotation>
377+ boot.loader.systemd-boot.enable = true; # <lineannotation>(for UEFI systems only)</lineannotation>
378379 # Note: setting fileSystems is generally not
380 # necessary, since nixos-generate-config figures them out
···386}</screen>
387</example>
3880389<xi:include href="installing-usb.xml" />
390<xi:include href="installing-pxe.xml" />
391<xi:include href="installing-virtualbox-guest.xml" />
+1-1
nixos/doc/manual/release-notes/rl-1404.xml
···13<itemizedlist>
1415 <listitem><para>Installation on UEFI systems is now supported. See
16- <xref linkend="sec-uefi-installation"/> for
17 details.</para></listitem>
1819 <listitem><para>Systemd has been updated to version 212, which has
···13<itemizedlist>
1415 <listitem><para>Installation on UEFI systems is now supported. See
16+ <xref linkend="sec-installation"/> for
17 details.</para></listitem>
1819 <listitem><para>Systemd has been updated to version 212, which has