NixOS Installation¶
Pre-Installation Guide
This guide assumes that you have followed the pre-installation guide.
- 
Partition your disk using
cfdiskor the tool of your preference, initialize the partitions with themkfscommand of the filesystem you want (mkswapis for swap) and mount them under/mnt.Note: You might want to leave a little part of your disk as a FAT32 partition to be able to transfer files easily between MacOS and Linux.
 - 
To connect to internet, you should load the firmware with these commands first:
sudo mkdir -p /lib/firmware/brcm sudo cp /mnt/boot/firmware/* /lib/firmware/brcm sudo modprobe -r brcmfmac && sudo modprobe brcmfmacThen run
systemctl start wpa_supplicantand then connect to internet usingwpa_cli. When running the commands, don't forget to change/mnt/bootto the place you mounted your ESP at (for example/mnt/boot/efi). - 
Generate your configuration using
sudo nixos-generate-config --root /mnt. - 
Edit
/mnt/etc/nixos/configuration.nix:- Add 
"${builtins.fetchGit { url = "https://github.com/NixOS/nixos-hardware.git"; }}/apple/t2"toimports. - 
Copy the WiFi/Bluetooth firmware to
/mnt/etc/nixos/firmware/brcmand add this snippet to yourconfiguration.nix:hardware.firmware = [ (pkgs.stdenvNoCC.mkDerivation { name = "brcm-firmware"; buildCommand = '' dir="$out/lib/firmware" mkdir -p "$dir" cp -r ${./files/firmware}/* "$dir" ''; }) ]; - 
Add a bootloader,
systemd-bootworks quite well. If you want to useGRUB, don't forget to setboot.grub.efiInstallAsRemovable,boot.grub.efiSupporttotrueandboot.grub.deviceto"nodev". - Run 
sudo nixos-install. 
 - Add 
 
And the installation is complete! Note that you should probably transition to a more structured configuration using flakes, that is omitted here for brevity.