NixOS: Difference between revisions
Appearance
Created page with " == Install == The graphical installer is trivial. However, the minimal ISO doesn't handle partitioning for you. === Partitioning and Formatting === ```bash # Create a new GPT partition table parted /dev/sda -- mklabel gpt # Create the EFI Boot partition parted /dev/sda -- mkpart ESP fat32 1MB 512MB parted /dev/sda -- set 1 esp on # Create the Root partition (ext4) parted /dev/sda -- mkpart primary ext4 512MB 100% # Format partitions mkfs.fat -F 32 -n boot /dev/sda1..." |
No edit summary |
||
| Line 4: | Line 4: | ||
=== Partitioning and Formatting === | === Partitioning and Formatting === | ||
<syntaxhighlight lang="bash> | |||
# Create a new GPT partition table | # Create a new GPT partition table | ||
parted /dev/sda -- mklabel gpt | parted /dev/sda -- mklabel gpt | ||
| Line 31: | Line 31: | ||
mkswap /mnt/swapfile | mkswap /mnt/swapfile | ||
swapon /mnt/swapfile | swapon /mnt/swapfile | ||
</syntaxhighlight> | |||
=== Generate a config and install=== | === Generate a config and install=== | ||
<syntaxhighlight lang="bash"> | |||
nixos-generate-config --root /mnt | nixos-generate-config --root /mnt | ||
# Edit the config to your desire | # Edit the config to your desire | ||
| Line 40: | Line 40: | ||
nixos-install | nixos-install | ||
</syntaxhighlight> | |||
== Resources== | == Resources== | ||
* https://nixos.org/manual/nixos/stable/ | * https://nixos.org/manual/nixos/stable/ | ||
* https://wiki.nixos.org/wiki/NixOS_Wiki | * https://wiki.nixos.org/wiki/NixOS_Wiki | ||
Revision as of 23:10, 21 December 2025
Install
The graphical installer is trivial. However, the minimal ISO doesn't handle partitioning for you.
Partitioning and Formatting
# Create a new GPT partition table
parted /dev/sda -- mklabel gpt
# Create the EFI Boot partition
parted /dev/sda -- mkpart ESP fat32 1MB 512MB
parted /dev/sda -- set 1 esp on
# Create the Root partition (ext4)
parted /dev/sda -- mkpart primary ext4 512MB 100%
# Format partitions
mkfs.fat -F 32 -n boot /dev/sda1
mkfs.ext4 -L nixos /dev/sda2
# Mount the root partition
mount /dev/disk/by-label/nixos /mnt
# Mount the boot partition
mkdir -p /mnt/boot
mount /dev/disk/by-label/boot /mnt/boot
# Create a 4GB swapfile (adjust size as needed)
dd if=/dev/zero of=/mnt/swapfile bs=1M count=4096
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
Generate a config and install
nixos-generate-config --root /mnt
# Edit the config to your desire
nano /mnt/etc/nixos/configuration.nix
nixos-install