4.9 KiB
NixOS Install Guide (wipe NVMe, install from flake on Integral300)
This guide assumes:
- You are currently on Ubuntu
- You will WIPE the entire NVMe: /dev/nvme0n1
- You will install NixOS with:
- UEFI + systemd-boot
- Btrfs with subvolumes (@ and @home)
- No encryption
- zram swap (configured in NixOS config)
- Your config repo is a flake with output:
#sam-4screen-desktop - Integral300 (ext4) is available and will be mounted on NixOS at: /data
- UUID: 27febd74-20aa-4a3a-92c1-6fdd1ad7e88e
Important constraints:
hosts/sam-4screen-desktop/hardware-configuration.nixis currently a placeholder. You MUST generate and copy the real one during install before running nixos-install.
A) On Ubuntu: prepare and push the config repo to Gitea
-
Go to your repo folder (example):
- If your repo is on Integral300 already:
cd /media/sam/Integral300/<your-repo-folder>
- Otherwise clone it to Integral300:
cd /media/sam/Integral300git clone ssh://git@<your-gitea-host>:<port>/<owner>/<repo>.git nixos-configcd nixos-config
- If your repo is on Integral300 already:
-
Ensure the flake evaluates:
nix --versionnix flake show
-
Commit your changes:
git statusgit add -Agit commit -m "chore: prep install guide + dotfiles links"
-
Push to Gitea:
git push
If you don’t have flake.lock yet, you can create it:
nix flake lockThen commit/push it too.
B) Boot NixOS installer (ISO)
- Boot the NixOS ISO (graphical or minimal).
- Open a terminal.
C) Wipe / partition / format / mount (CLI method)
WARNING: This wipes the whole NVMe. Double-check the disk is correct.
1) Identify disks
lsblk -fConfirm:- NVMe target: /dev/nvme0n1 (about 953G)
- Integral300 disk by UUID is present: 27febd74-20aa-4a3a-92c1-6fdd1ad7e88e
2) Wipe and create partitions
This creates:
- p1 = EFI (1GiB)
- p2 = Btrfs (rest)
Commands:
-
sudo wipefs -a /dev/nvme0n1 || true -
sudo sgdisk --zap-all /dev/nvme0n1 -
sudo sgdisk -n 1:1MiB:+1GiB -t 1:EF00 -c 1:EFI /dev/nvme0n1 -
sudo sgdisk -n 2:0:0 -t 2:8300 -c 2:NIXOS /dev/nvme0n1
Verify:
sudo fdisk -l /dev/nvme0n1
3) Format
sudo mkfs.fat -F32 -n EFI /dev/nvme0n1p1sudo mkfs.btrfs -L nixos /dev/nvme0n1p2
4) Create Btrfs subvolumes
sudo mount /dev/nvme0n1p2 /mntsudo btrfs subvolume create /mnt/@sudo btrfs subvolume create /mnt/@homesudo umount /mnt
5) Mount target layout for install
sudo mount -o subvol=@,compress=zstd,noatime /dev/nvme0n1p2 /mntsudo mkdir -p /mnt/homesudo mount -o subvol=@home,compress=zstd,noatime /dev/nvme0n1p2 /mnt/home
Mount EFI at /mnt/boot (systemd-boot expects /boot):
sudo mkdir -p /mnt/bootsudo mount /dev/nvme0n1p1 /mnt/boot
6) Mount Integral300 so we can access the flake repo (offline-friendly)
sudo mkdir -p /mnt/datasudo mount /dev/disk/by-uuid/27febd74-20aa-4a3a-92c1-6fdd1ad7e88e /mnt/data
D) Generate hardware-configuration.nix (REQUIRED)
- Generate:
sudo nixos-generate-config --root /mnt
- Copy the generated hardware config into your repo (overwrite placeholder):
- If your repo is at
/mnt/data/nixos-config:sudo cp /mnt/etc/nixos/hardware-configuration.nix /mnt/data/nixos-config/hosts/sam-4screen-desktop/hardware-configuration.nix
If your repo folder name is different, adjust accordingly.
Optional sanity check:
sed -n '1,200p' /mnt/data/nixos-config/hosts/sam-4screen-desktop/hardware-configuration.nix
E) Install NixOS using the flake
From the installer environment, run:
sudo nixos-install --flake /mnt/data/nixos-config#sam-4screen-desktop
Notes:
- The installer may ask you to set a root password. Do so.
- If you prefer not setting root password and using only your user + sudo, say so and we can adjust.
After install:
sudo reboot
F) First boot checklist (post-install)
- Connect to Wi-Fi:
nmtui(recommended)- Connect to SSID: "Aussie Broadband 8729"
- Verify static IP:
ip a show wlp4s2If it got DHCP, force one reconnect:nmcli networking off; nmcli networking onor:nmcli connection down "<connection name>"; nmcli connection up "<connection name>"
- Verify SSH works (from another machine):
ssh sam@192.168.20.27
- Verify /data mounted:
mount | grep ' /data 'ls -la /data/home_sam_ubuntu/dotfiles
- Home Manager activation:
home-manageris integrated via NixOS switch; it should apply on rebuild.- If dotfiles symlinks fail, confirm
/datais mounted and the dotfiles paths exist.
G) After install: commit the new hardware-configuration.nix
Back on your running system (or from Ubuntu before wiping, if you mounted and copied it there):
cd /data/nixos-config(or wherever your repo is)git statusgit add hosts/sam-4screen-desktop/hardware-configuration.nixgit commit -m "feat: add generated hardware-configuration for sam-4screen-desktop"git push