More actions
|  Created page with "Category:Technical guides  = introduction = this uses flakes  # obtain nixos ISO (graphical installer is nicer i guess) # boot it # open up a terminal and partition disk # wipe your disk: blkdiscard /dev/nvme0n1 = partition your disk = # create boot partition # create root partition # parted <device> # mklabel gpt # mkpart partitoin name? boot file system type? fat32 start? 0% end? 2GB # mkpart partitoin name? root file system type? btrfs start? 2GB end? 100% # set 1..." | No edit summary | ||
| Line 1: | Line 1: | ||
| [[Category:Technical guides]] | [[Category:Technical guides]] | ||
| =  | = Introduction = | ||
| This is a complete guide on installing NixOs, using flakes. | |||
| Be sure to have an ISO image of NixOS, which can be obtained here: https://nixos.org/download/#nixos-iso. | |||
| #  | |||
| =  | = Installation guide = | ||
| #  | == Partitioning your disk == | ||
| #  | # Open a terminal. | ||
| # Wipe your disk: {{ic|$ blkdiscard /dev/<installation disk>}}. | |||
| # Create root and boot partitions: | |||
| ===== Use parted ===== | |||
| <pre> | |||
| $ parted <installation disk> | |||
| (parted) mklabel gpt | |||
| </pre> | |||
| ===== Boot partition ===== | |||
| <pre> | |||
| (parted) mkpart | |||
| (parted) Partitoin name? boot | |||
| (parted) File system type? fat32 | |||
| (parted) Start? 0% | |||
| (parted) End? 2GB | |||
| (parted) set 1 esp on | |||
| (parted) set 1 boot on | |||
| </pre> | |||
| ===== Root partition ===== | |||
| <pre> | |||
| (parted) mkpart | |||
| (parted) Partitoin name? root | |||
| (parted) File system type? btrfs | |||
| (parted) Start? 2GB | |||
| (parted) End? 100% | |||
| (parted) quit | |||
| </pre> | |||
| =  | == Configure and mount partitions == | ||
| # {{ic|$ mkfs.btrfs  /dev/<root partition>}} | |||
| # {{ic|$ mkfs.vfat -F32 /dev/<boot partition>}} | |||
| # {{ic|$ mount /dev/<root partition> /mnt}} | |||
| # {{ic|$ mkdir /mnt/boot}} | |||
| # {{ic|$ mount /dev/<boot partition> /mnt/boot}} | |||
| =  | == Generate and edit config  == | ||
| sudo nixos-install | # {{ic|$ sudo nixos-generate-config --root /mnt}} | ||
| # {{ic|$ nvim /mnt/etc/nixos/configuration.nix}} | |||
| # {{ic|$ nvim /mnt/etc/nixos/hardware-configuration.nix}} | |||
| # Remember to add the following configuration so that grub works with EFI: | |||
| <pre> | |||
| boot.loader.grub.enable = true; | |||
| boot.loader.grub.efiSupport = true; | |||
| boot.loader.grub.device = "nodev"; | |||
| boot.loader.efi.canTouchEfiVariables = true; | |||
| </pre> | |||
| == Install == | |||
| # {{ic|$ sudo nixos-install}} | |||
| # Set root password when prompted to do so. | |||
| # Reboot your machine | |||
| # Login as root and set a password for your user: {{ic|$ passwd <username>}} | |||
| # Logout and login as your user | |||
Revision as of 22:24, 30 August 2024
Introduction
This is a complete guide on installing NixOs, using flakes.
Be sure to have an ISO image of NixOS, which can be obtained here: https://nixos.org/download/#nixos-iso.
Installation guide
Partitioning your disk
- Open a terminal.
- Wipe your disk: $ blkdiscard /dev/<installation disk>.
- Create root and boot partitions:
Use parted
$ parted <installation disk> (parted) mklabel gpt
Boot partition
(parted) mkpart (parted) Partitoin name? boot (parted) File system type? fat32 (parted) Start? 0% (parted) End? 2GB (parted) set 1 esp on (parted) set 1 boot on
Root partition
(parted) mkpart (parted) Partitoin name? root (parted) File system type? btrfs (parted) Start? 2GB (parted) End? 100% (parted) quit
Configure and mount partitions
- $ mkfs.btrfs /dev/<root partition>
- $ mkfs.vfat -F32 /dev/<boot partition>
- $ mount /dev/<root partition> /mnt
- $ mkdir /mnt/boot
- $ mount /dev/<boot partition> /mnt/boot
Generate and edit config
- $ sudo nixos-generate-config --root /mnt
- $ nvim /mnt/etc/nixos/configuration.nix
- $ nvim /mnt/etc/nixos/hardware-configuration.nix
- Remember to add the following configuration so that grub works with EFI:
boot.loader.grub.enable = true; boot.loader.grub.efiSupport = true; boot.loader.grub.device = "nodev"; boot.loader.efi.canTouchEfiVariables = true;
Install
- $ sudo nixos-install
- Set root password when prompted to do so.
- Reboot your machine
- Login as root and set a password for your user: $ passwd <username>
- Logout and login as your user
