NixOS Installation Guide: Difference between revisions
imported>Samueldr m →Using Unetbootin: Fixes an oopsie |
imported>Samueldr m →Making the installation media: Updated "Making the installation media" |
||
Line 23: | Line 23: | ||
== Making the installation media == | == Making the installation media == | ||
Since NixOS 14.11 the installer ISO is hybrid. This means it is bootable on both CD and USB drives. It also boots on EFI systems, like most modern motherboards and | Since NixOS 14.11 the installer ISO is hybrid. This means it is bootable on both CD and USB drives. It also boots on EFI systems, like most modern motherboards and apple systems. The following instructions will assume the standard way of copying the image to an USB drive. When using a CD or DVD, the usual methods to burn to disk should work with the iso. | ||
=== "Burning" to USB drive === | |||
First, download a [http://nixos.org/nixos/download.html NixOS ISO image] or [[Creating a Nix OS live CD|create a custom ISO]]. Then plug in a USB stick large enough to accommodate the image. Then follow the platform instructions: | |||
==== From Linux ==== | |||
# Find the right device with <code>lsblk</code> or <code>fdisk -l</code>. Replace <code><i>/dev/sdX</i></code> with the proper device in the following steps. | |||
# Find the right device with <code>fdisk -l</code> | # Burn with: <code>cp nixos-xxx.iso <em>/dev/sdX</em></code> | ||
# Burn with: <code>cp nixos-xxx.iso /dev/ | |||
{{note|do not use /dev/sdX1 or partitions of the disk, use the whole disk /dev/sdX.}} | |||
# Find the right device with <code>diskutil list</code>, let's say <code> | |||
# Unmount with <code>diskutil unmountDisk | Writing the disk image with <code>dd</code> also works. | ||
# Burn with: <code>sudo dd if=<b>path_to_nixos.iso</b> of=/dev/<b>r</b> | |||
==== From macOS ==== | |||
{{outdated:inline|Instructions are not verified to be working as of 2017-11-25, it is most likely they work, please remove this warning when tested.}} | |||
# Find the right device with <code>diskutil list</code>, let's say <code><i>diskX</i></code>. | |||
# Unmount with <code>diskutil unmountDisk <i>diskX</i></code>. | |||
# Burn with: <code>sudo dd if=<b>path_to_nixos.iso</b> of=/dev/<b>r</b><i>diskX</i> bs=64k</code> | |||
{{note|Use <code>rdisk</code> instead of <code>disk</code>, this makes a large speed difference. You can check the write speed with <code>iostat 2</code> in another terminal.}} | |||
You could use Disk Utility to write the image but then you'd need to convert it first to a compatible format somehow. | You could use Disk Utility to write the image but then you'd need to convert it first to a compatible format somehow. | ||
==== From Windows ==== | |||
{{outdated:inline|Instructions are not verified to be working as of 2017-11-25, it is most likely they work, please remove this warning when tested.}} | |||
# Download [http://sourceforge.net/projects/usbwriter/ USBwriter]. | # Download [http://sourceforge.net/projects/usbwriter/ USBwriter]. | ||
# Start USBwriter. | # Start USBwriter. | ||
Line 53: | Line 59: | ||
# When USBwriter has finished writing, safely unplug the USB drive. | # When USBwriter has finished writing, safely unplug the USB drive. | ||
=== Alternative installation media instructions === | |||
=== | |||
= | |||
The previous methods are the supported methods of making the USB installation media. | |||
Those methods are also documented, they can allow using the USB drive to boot multiple distributions. This is not supported, your mileage may vary. | |||
* [[NixOS_Installation_Guide/Unetbootin|Using Unetbootin]] | |||
* [[NixOS_Installation_Guide/Manual USB Creation|Manual USB Creation]] | |||
== Build a custom installation image == | == Build a custom installation image == |
Revision as of 23:07, 25 November 2017
This guide is a companion guide for the official manual. In addition to describing the steps from the official manual, it provides known good instructions for common use cases. When there is a discrepancy between the manual and this guide, the supported case is the one described in the manual.
Use this guide as a step-by-step guide, choices will be presented, use only the selected section, and continue at the section it tells you to at the end.
Installation target
NixOS can be installed on an increasing variety of hardware, including the usual x86-type hardware.
- A regular (Intel or AMD) desktop computer, laptop, or physically accessible server can follow the instructions in this page
- SBCs, like the Raspberry Pis, and other ARM boards can follow the instructions at NixOS on ARM
- Cloud and remote servers will find various instructions at NixOS friendly hosters
Installation method
NixOS, as with most Linux-based operating systems, can be installed in different ways.
- The classic way, booting from the installation media (described in this page)
- Booting the media from an existing Linux installation
Making the installation media
Since NixOS 14.11 the installer ISO is hybrid. This means it is bootable on both CD and USB drives. It also boots on EFI systems, like most modern motherboards and apple systems. The following instructions will assume the standard way of copying the image to an USB drive. When using a CD or DVD, the usual methods to burn to disk should work with the iso.
"Burning" to USB drive
First, download a NixOS ISO image or create a custom ISO. Then plug in a USB stick large enough to accommodate the image. Then follow the platform instructions:
From Linux
- Find the right device with
lsblk
orfdisk -l
. Replace/dev/sdX
with the proper device in the following steps. - Burn with:
cp nixos-xxx.iso /dev/sdX
Writing the disk image with dd
also works.
From macOS
- Find the right device with
diskutil list
, let's saydiskX
. - Unmount with
diskutil unmountDisk diskX
. - Burn with:
sudo dd if=path_to_nixos.iso of=/dev/rdiskX bs=64k
You could use Disk Utility to write the image but then you'd need to convert it first to a compatible format somehow.
From Windows
- Download USBwriter.
- Start USBwriter.
- Choose the downloaded ISO as 'Source'
- Choose the USB drive as 'Target'
- Click 'Write'
- When USBwriter has finished writing, safely unplug the USB drive.
Alternative installation media instructions
The previous methods are the supported methods of making the USB installation media.
Those methods are also documented, they can allow using the USB drive to boot multiple distributions. This is not supported, your mileage may vary.
Build a custom installation image
NixOS provides an easy way to build a custom variant of the installation image. This might be useful to embed your own ssh key or enable additional features like zfs support. It allows to specify a custom configuration.nix
which is used to build the image
This is explained in Creating a NixOS live CD.
Installing on VPS & Cloud Providers
→ See NixOS friendly hosters
Special hardware
- Blog post how to install NixOS on a Dell 9560
- for embedded Hardware like the Raspberry Pi2 see NixOS on ARM
- Brand servers may require extra kernel modules be included into initrd (boot.initrd.extraKernelModules in configuration.nix) For example HP Proliant needs "hpsa" module to see the disk drive.