290 lines
6 KiB
Markdown
290 lines
6 KiB
Markdown
# 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.
|
|
|
|
1. **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).*
|
|
|
|
2. **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
|
|
```
|
|
|
|
3. **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.
|
|
|
|
1. Reboot and enter BIOS (usually F2 or Del).
|
|
|
|
2. Find **Graphics Memory**, **UMA Frame Buffer**, or **iGPU Memory**.
|
|
|
|
3. 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.*
|
|
|
|
1. **Partition:** `cfdisk /dev/nvme0n1` (Delete all, Create 4G Boot + Remaining Root).
|
|
|
|
2. **Format:**
|
|
|
|
```
|
|
mkfs.fat -F 32 -n BOOT /dev/nvme0n1p1
|
|
mkfs.btrfs -L nixos /dev/nvme0n1p2
|
|
```
|
|
|
|
3. **Create Subvolumes:**
|
|
|
|
```
|
|
mount /dev/nvme0n1p2 /mnt
|
|
btrfs subvolume create /mnt/@
|
|
btrfs subvolume create /mnt/@home
|
|
btrfs subvolume create /mnt/@nix
|
|
umount /mnt
|
|
```
|
|
|
|
4. **Proceed to Step "Mounting" below.**
|
|
|
|
### Path B: Migration (Keep /home data)
|
|
|
|
*Use this to delete CachyOS but KEEP your existing data in `@home`.*
|
|
|
|
1. **Mount the Top-Level Partition:**
|
|
|
|
```
|
|
mount /dev/nvme0n1p2 /mnt
|
|
```
|
|
|
|
2. **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
|
|
```
|
|
|
|
3. **Prepare NixOS Subvolumes:**
|
|
|
|
```
|
|
btrfs subvolume create /mnt/@
|
|
btrfs subvolume create /mnt/@nix
|
|
```
|
|
|
|
*(Note: Ensure your existing home data is in a subvolume named `@home`.)*
|
|
|
|
4. **Format Boot Partition:**
|
|
|
|
```
|
|
mkfs.fat -F 32 -n BOOT /dev/nvme0n1p1
|
|
```
|
|
|
|
5. **Unmount:**
|
|
|
|
```
|
|
umount /mnt
|
|
```
|
|
|
|
### Mounting (Common for Both Paths)
|
|
|
|
1. **Mount Root (`@`):**
|
|
|
|
```
|
|
mount -o compress=zstd,subvol=@ /dev/nvme0n1p2 /mnt
|
|
```
|
|
|
|
2. **Create Mount Points:**
|
|
|
|
```
|
|
mkdir -p /mnt/{home,nix,boot}
|
|
```
|
|
|
|
3. **Mount Home (`@home`):**
|
|
|
|
```
|
|
mount -o compress=zstd,subvol=@home /dev/nvme0n1p2 /mnt/home
|
|
```
|
|
|
|
4. **Mount Nix Store (`@nix`):**
|
|
|
|
```
|
|
mount -o compress=zstd,noatime,subvol=@nix /dev/nvme0n1p2 /mnt/nix
|
|
```
|
|
|
|
5. **Mount Boot:**
|
|
|
|
```
|
|
mount /dev/nvme0n1p1 /mnt/boot
|
|
```
|
|
|
|
### C. Deploy Configuration (Git Method)
|
|
|
|
1. **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/"
|
|
```
|
|
|
|
2. **Generate Hardware Scan:**
|
|
This creates `hardware-configuration.nix` in the folder.
|
|
|
|
```
|
|
nixos-generate-config --root /mnt
|
|
```
|
|
|
|
*(Ignore the warning about configuration.nix existing)*
|
|
|
|
### D. Install & Set Password
|
|
|
|
1. **Run the Installer:**
|
|
|
|
```
|
|
nixos-install --flake /mnt/etc/nixos#electra
|
|
```
|
|
|
|
*If prompted to set a ROOT password, go ahead and set one.*
|
|
|
|
2. **Set USER Password (Critical):**
|
|
Do not reboot yet! We need to set the password for `nimmo`.
|
|
|
|
Enter the new system environment:
|
|
|
|
```
|
|
nixos-enter
|
|
```
|
|
|
|
Set the password:
|
|
|
|
```
|
|
passwd nimmo
|
|
```
|
|
|
|
Exit the environment:
|
|
|
|
```
|
|
exit
|
|
```
|
|
|
|
3. **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:**
|
|
|
|
1. Edit your files in `/etc/nixos/` (or pull changes from git).
|
|
|
|
2. (Optional) Commit your changes: `git commit -am "Update config"`
|
|
|
|
3. 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
|
|
|
|
1. Go to **System Settings -> Users** and click "Configure Fingerprint".
|
|
|
|
2. If that fails, run `fprintd-enroll` in a terminal.
|
|
|
|
3. **Usage:**
|
|
|
|
* **Login (SDDM):** Password only (required to unlock KWallet).
|
|
|
|
* **Unlock Screen:** Fingerprint or Password.
|
|
|
|
* **Sudo (Terminal):** Fingerprint or Password.
|