NixOS Installation Guide: Difference between revisions

imported>Ixxie
No edit summary
imported>Ixxie
Fixed headers install from linux section.
Line 230: Line 230:
The following sections outline two installation methods. Choose the one that suits you best.
The following sections outline two installation methods. Choose the one that suits you best.


== Installing through a chroot ==
=== Installing through a chroot ===
In this section we will install NixOS by unpacking the ISO and then chrooting into its contents to start the final install.
In this section we will install NixOS by unpacking the ISO and then chrooting into its contents to start the final install.


=== Preparations ===
==== Preparations ====
Get a NixOS ISO and unpack the squashfs filesystem containing the nix store. A tool from squashfs-tools is required, so install that package first.
Get a NixOS ISO and unpack the squashfs filesystem containing the nix store. A tool from squashfs-tools is required, so install that package first.


Line 272: Line 272:
# sed -i "s,exec systemd,exec /$BASH," $INIT
# sed -i "s,exec systemd,exec /$BASH," $INIT
</syntaxhighlight>
</syntaxhighlight>
=== Starting the install ===
 
==== Starting the install ====
 
Now we are able to chroot into the NixOS system used for installation. ''You may get several warnings and errors, but you can safely ignore them unless they are fatal.'' If you're installing from Arch, you may need to remove the mount call that tries to make / private in the same init script.
Now we are able to chroot into the NixOS system used for installation. ''You may get several warnings and errors, but you can safely ignore them unless they are fatal.'' If you're installing from Arch, you may need to remove the mount call that tries to make / private in the same init script.
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
Line 301: Line 303:
Once you're done tweaking, exit the chroot (exit or ctrl-d will) and reboot. With any luck, you will have new choices in the GRUB menu to choose from.
Once you're done tweaking, exit the chroot (exit or ctrl-d will) and reboot. With any luck, you will have new choices in the GRUB menu to choose from.


== Running the LiveCD installer from disk ==
=== Running the LiveCD installer from disk ===
In this section we will install NixOS by transfering the installer from the ISO to a bootable partition and then running it.
In this section we will install NixOS by transfering the installer from the ISO to a bootable partition and then running it.


Line 310: Line 312:
* /etc will be merged, so your current settings can interfere with the final installation steps
* /etc will be merged, so your current settings can interfere with the final installation steps


=== Unpacking the ISO image ===
==== Unpacking the ISO image ====
 
<syntaxhighlight lang="console">
<syntaxhighlight lang="console">
# wget https://d3g5gsiof5omrk.cloudfront.net/nixos/17.03/nixos-17.03.1449.2e983f14f6/nixos-minimal-17.03.1449.2e983f14f6-x86_64-linux.iso # get the latest iso (URL might change!)
# wget https://d3g5gsiof5omrk.cloudfront.net/nixos/17.03/nixos-17.03.1449.2e983f14f6/nixos-minimal-17.03.1449.2e983f14f6-x86_64-linux.iso # get the latest iso (URL might change!)
Line 321: Line 324:
</syntaxhighlight>
</syntaxhighlight>


=== Modifying your bootloader's config ===
==== Modifying your bootloader's config ====


Look at some_dir/boot/grub/grub.cfg. This is Grub-2 main config file of the ISO.
Look at some_dir/boot/grub/grub.cfg. This is Grub-2 main config file of the ISO.
Line 336: Line 339:
init argument.
init argument.


==== GRUB 1 ====
===== GRUB 1 =====


To setup grub-1, edit your /boot/grub/menu.lst (or equivalent). Add following
To setup grub-1, edit your /boot/grub/menu.lst (or equivalent). Add following
Line 351: Line 354:
Go to the reboot section
Go to the reboot section


==== GRUB 2 ====
===== GRUB 2 =====


A grub entry for ubuntu might look like this:
A grub entry for ubuntu might look like this:
Line 362: Line 365:
</pre>
</pre>


==== Other bootloaders ====
===== Other bootloaders =====


Should also work. Please add instructions here.
Should also work. Please add instructions here.


=== Booting into LiveCD ===
==== Booting into LiveCD ====


Reboot. Select "NixOS LiveCD" from the bootloader menu. If everything is OK, you
Reboot. Select "NixOS LiveCD" from the bootloader menu. If everything is OK, you