NixOS Installation Guide: Difference between revisions

imported>Matu3ba
add instructions from Til's Guide on youtube
imported>Matu3ba
fix headers
Line 95: Line 95:
On the minimal ISO, or if you are more familiar with <code>wpa_supplicant</code> then you can also run <code>wpa_passphrase ESSID | sudo tee /etc/wpa_supplicant.conf</code>, then enter your password and <code>systemctl restart wpa_supplicant</code>.
On the minimal ISO, or if you are more familiar with <code>wpa_supplicant</code> then you can also run <code>wpa_passphrase ESSID | sudo tee /etc/wpa_supplicant.conf</code>, then enter your password and <code>systemctl restart wpa_supplicant</code>.


=== Partitioning ===
== Partitioning ==


To partition the persistent storage run <code>sudo fdisk /dev/diskX</code> and follow instructions for DOS or (U)EFI.
To partition the persistent storage run <code>sudo fdisk /dev/diskX</code> and follow instructions for DOS or (U)EFI.
A very simple example setup is given here.
A very simple example setup is given here.


==== DOS ====
=== DOS ===


* o (dos disk label)
* o (dos disk label)
Line 116: Line 116:
* w (write)
* w (write)


==== UEFI ====
=== UEFI ===


* g (gpt disk label)
* g (gpt disk label)
Line 131: Line 131:
* w (write)
* w (write)


=== Label partitions ===
== Label partitions ==


This is useful for having multiple setups and makes paritions easier to handle.
This is useful for having multiple setups and makes paritions easier to handle.
Line 142: Line 142:
* sudo mount /dev/disk/by-label/NIXBOOT /mnt/boot
* sudo mount /dev/disk/by-label/NIXBOOT /mnt/boot


=== Swap file (only simple on uefi) ===
== Swap file (only simple on uefi) ==
* sudo dd if=/dev/zero of=/mnt/.swapfile bs=1024 count=2097152 (2GB size)
* sudo dd if=/dev/zero of=/mnt/.swapfile bs=1024 count=2097152 (2GB size)
* sudo chmod 600 /mnt/.swapfile
* sudo chmod 600 /mnt/.swapfile
Line 148: Line 148:
* sudo swapon /mnt/.swapfile
* sudo swapon /mnt/.swapfile


=== NixOS config ===
== NixOS config ==
* sudo nixos-generate-config --root /mnt
* sudo nixos-generate-config --root /mnt
* cd /mnt/etc/nixos/
* cd /mnt/etc/nixos/
Line 160: Line 160:
6. change hardware config to use labels
6. change hardware config to use labels


=== NixOS installation ===
== NixOS installation ==


* cd /mnt
* cd /mnt