Booting from a USB Drive
For systems without CD drive, the NixOS live CD can be booted from a USB
stick. You can use the dd utility to write the image:
dd if=path-to-image
of=/dev/sdb. Be careful about specifying
the correct drive; you can use the lsblk command to get a
list of block devices.
On macOS:
$ diskutil list
[..]
/dev/diskN (external, physical):
#: TYPE NAME SIZE IDENTIFIER
[..]
$ diskutil unmountDisk diskN
Unmount of all volumes on diskN was successful
$ sudo dd bs=1m if=nix.iso of=/dev/rdiskN
Using the 'raw' rdiskN device instead of
diskN completes in minutes instead of hours. After
dd completes, a GUI dialog "The disk you inserted was not
readable by this computer" will pop up, which can be ignored.
The dd utility will write the image verbatim to the drive,
making it the recommended option for both UEFI and non-UEFI installations.
For non-UEFI installations, you can alternatively use
unetbootin. If
you cannot use dd for a UEFI installation, you can also
mount the ISO, copy its contents verbatim to your drive, then either:
Change the label of the disk partition to the label of the ISO (visible
with the blkid command), or
Edit loader/entries/nixos-livecd.conf on the drive
and change the root= field in the
options line to point to your drive (see the
documentation on root= in
the kernel documentation for more details).
If you want to load the contents of the ISO to ram after bootin (So you
can remove the stick after bootup) you can append the parameter
copytoram to the options field.