6 KiB
Nimmo's NixOS Setup Guide (Host: electra)
0. Pre-Installation Preparation (Do this NOW on CachyOS)
Since you are hosting this on git.nimmog.uk, we will create the config locally and push it before booting the installer.
-
Create the Repository on your Server:
-
Log into
https://git.nimmog.uk. -
Create a new empty repository named
nixos-config. -
Do not initialize with README or license (keep it empty).
-
-
Create Files Locally: Open a terminal in CachyOS:
mkdir ~/nixos-config cd ~/nixos-config # Run the creation script provided by Gemini to generate files here -
Initialize & Push:
git init git branch -M main git add . git commit -m "Initial commit: Setup for electra" # Replace with your actual SSH or HTTPS URL git remote add origin https://git.nimmog.uk/YOUR_USERNAME/nixos-config.git git push -u origin main
1. Initial BIOS Setup (Crucial)
Before booting NixOS, you must configure the BIOS to handle the memory split for your LLMs.
-
Reboot and enter BIOS (usually F2 or Del).
-
Find Graphics Memory, UMA Frame Buffer, or iGPU Memory.
-
Set this to 16G (or "Game Optimized" if it equates to high memory).
2. Installation
Once you have booted the NixOS Unstable ISO, choose your path below.
Path A: Fresh Install (Wipe Everything)
Use this if you want to start completely fresh.
-
Partition:
cfdisk /dev/nvme0n1(Delete all, Create 4G Boot + Remaining Root). -
Format:
mkfs.fat -F 32 -n BOOT /dev/nvme0n1p1 mkfs.btrfs -L nixos /dev/nvme0n1p2 -
Create Subvolumes:
mount /dev/nvme0n1p2 /mnt btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@home btrfs subvolume create /mnt/@nix umount /mnt -
Proceed to Step "Mounting" below.
Path B: Migration (Keep /home data)
Use this to delete CachyOS but KEEP your existing data in @home.
-
Mount the Top-Level Partition:
mount /dev/nvme0n1p2 /mnt -
List & Cleanup: Run
ls -a /mnt. Delete the OLD Operating System: Warning: Be extremely careful. Do NOT delete@home.# Delete the old root and system folders btrfs subvolume delete /mnt/@ btrfs subvolume delete /mnt/@root btrfs subvolume delete /mnt/@srv btrfs subvolume delete /mnt/@log btrfs subvolume delete /mnt/@cache btrfs subvolume delete /mnt/@tmp btrfs subvolume delete /mnt/@.snapshots -
Prepare NixOS Subvolumes:
btrfs subvolume create /mnt/@ btrfs subvolume create /mnt/@nix(Note: Ensure your existing home data is in a subvolume named
@home.) -
Format Boot Partition:
mkfs.fat -F 32 -n BOOT /dev/nvme0n1p1 -
Unmount:
umount /mnt
Mounting (Common for Both Paths)
-
Mount Root (
@):mount -o compress=zstd,subvol=@ /dev/nvme0n1p2 /mnt -
Create Mount Points:
mkdir -p /mnt/{home,nix,boot} -
Mount Home (
@home):mount -o compress=zstd,subvol=@home /dev/nvme0n1p2 /mnt/home -
Mount Nix Store (
@nix):mount -o compress=zstd,noatime,subvol=@nix /dev/nvme0n1p2 /mnt/nix -
Mount Boot:
mount /dev/nvme0n1p1 /mnt/boot
C. Deploy Configuration (Git Method)
-
Clone Your Repo:
mkdir -p /mnt/etc/nixos # Replace USERNAME with your git.nimmog.uk user nix-shell -p git --run "git clone https://git.nimmog.uk/USERNAME/nixos-config.git /mnt/etc/nixos/" -
Generate Hardware Scan: This creates
hardware-configuration.nixin the folder.nixos-generate-config --root /mnt(Ignore the warning about configuration.nix existing)
D. Install & Set Password
-
Run the Installer:
nixos-install --flake /mnt/etc/nixos#electraIf prompted to set a ROOT password, go ahead and set one.
-
Set USER Password (Critical): Do not reboot yet! We need to set the password for
nimmo.Enter the new system environment:
nixos-enterSet the password:
passwd nimmoExit the environment:
exit -
Reboot:
reboot
3. Bus ID Configuration (Done)
-
NVIDIA: 193 (
c1:00.0) -
AMD: 194 (
c2:00.0)
4. Applying Changes (Post-Install)
To apply updates or config changes:
-
Edit your files in
/etc/nixos/(or pull changes from git). -
(Optional) Commit your changes:
git commit -am "Update config" -
Rebuild:
sudo nixos-rebuild switch --flake /etc/nixos/#electra
5. Boot Modes (Select at Boot)
You will see four options in your bootloader. Use arrow keys to select.
1. NixOS Default
-
Setup: NVIDIA + Balanced Power (KDE).
-
Use when: NVIDIA Module INSERTED.
2. Gaming-Zen
-
Setup: NVIDIA + Zen Kernel + Max Performance.
-
Use when: Gaming with NVIDIA Module INSERTED.
3. Eco-Battery
-
Setup: NVIDIA + TLP (Max Saver).
-
Use when: Traveling with NVIDIA Module INSERTED.
4. No-dGPU (Expansion Shell)
-
Setup: NO NVIDIA DRIVERS. iGPU Only.
-
Use when: You have physically REMOVED the GPU module and inserted the blank Expansion Shell.
-
Note: If you boot Default with the GPU removed, the system will likely fail to reach the desktop.
6. Adding New Apps
-
CLI Tools: Edit
system-utils.nix. -
GUI Apps: Edit
user-apps.nix. -
After editing: Run the rebuild command in step 4.
7. Docker
Docker is installed and running in Rootless mode. You can run docker commands immediately as user nimmo:
docker run hello-world
8. Fingerprint Reader
-
Go to System Settings -> Users and click "Configure Fingerprint".
-
If that fails, run
fprintd-enrollin a terminal. -
Usage:
-
Login (SDDM): Password only (required to unlock KWallet).
-
Unlock Screen: Fingerprint or Password.
-
Sudo (Terminal): Fingerprint or Password.
-