4.0 KiB
4.0 KiB
🚀 Getting Started & Disaster Recovery
This document is the operational procedure for bootstrapping the workstation host (laptop) from bare metal or recovering after a catastrophic drive failure.
1. Prerequisites & Installation Media
- Download the latest official NixOS Minimal ISO from nixos.org.
- Flash the ISO to a USB flash drive:
sudo dd if=nixos-minimal-*.iso of=/dev/sdX bs=4M status=progress conv=fsync - Boot the laptop from the USB drive in UEFI mode.
2. Disk Partitioning & Mounting
Assuming NVMe target drive /dev/nvme0n1:
# 1. Create GPT partition table
parted /dev/nvme0n1 -- mklabel gpt
# 2. EFI System Partition (1GB, FAT32)
parted /dev/nvme0n1 -- mkpart ESP fat32 1MiB 1024MiB
parted /dev/nvme0n1 -- set 1 esp on
# 3. Root Partition (remaining space, Ext4 or Btrfs)
parted /dev/nvme0n1 -- mkpart primary ext4 1024MiB 100%
# 4. Format filesystems
mkfs.fat -F 32 -n BOOT /dev/nvme0n1p1
mkfs.ext4 -L nixos /dev/nvme0n1p2
# 5. Mount targets for installation
mount /dev/disk/by-label/nixos /mnt
mkdir -p /mnt/boot
mount /dev/disk/by-label/BOOT /mnt/boot
3. Clone Repository & Hardware Detection
# Generate hardware configuration scan into a temporary directory
nixos-generate-config --root /mnt
# Clone the declarative workstation configuration
git clone https://github.com/kiskaadee/Config.git /mnt/etc/nixos
# Replace the repository hardware configuration with the generated one
cp /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/system/hardware-configuration.nix
Important
Verify that the filesystem UUIDs in
system/hardware-configuration.nixmatch the output ofblkid /dev/nvme0n1p*.
4. Install & Initial System Build
# Enable flakes on the installer shell
export NIX_CONFIG="experimental-features = nix-command flakes"
# Perform initial system installation using the laptop target
nixos-install --flake /mnt/etc/nixos#laptop
# Set root and user passwords when prompted, then reboot:
reboot
5. First Graphical Login & Desktop Bootstrap
- Remove the USB flash drive and boot into the installed system.
- At the
dank-greeterdisplay manager screen, log in askiskaadee. - Open a terminal (
Mod+Return).
Desktop Initialization Phase
On a fresh machine, DMS requires a one-time setup command to seed its mutable baseline keybindings:
dms setup binds
This generates ~/.config/niri/dms/binds.kdl with standard user write permissions (0644). From this point forward:
- Niri loads all standard DMS IPC shortcuts (
Mod+Spacefor spotlight launcher,Mod+Vfor clipboard,Mod+Mfor task manager,Super+Xfor power menu, volume and brightness controls). - DMS owns, updates, and mutates
~/.config/niri/dms/and~/.config/DankMaterialShell/settings.jsonwithout conflicting with the declarative Nix store.
6. Operator Secrets Bootstrap (Access to Core)
The workstation acts as the administrative cockpit for the homelab. To enable editing and rotating secrets in Core:
- Restore your personal
agesecret key from a secure backup (e.g. Bitwarden or offline medium) into:mkdir -p ~/.config/sops/age chmod 700 ~/.config/sops/age # Place your private key in: # ~/.config/sops/age/keys.txt chmod 600 ~/.config/sops/age/keys.txt - Verify operator decryption capability:
cd ~/Projects/active/homelab/Core/nixos sops secrets.yaml
7. Verification Checklist
| Check | Command | Expected Outcome |
|---|---|---|
| Flake Validation | nix flake check |
Evaluates with zero errors. |
| Dry Build | nix build .#nixosConfigurations.laptop.config.system.build.toplevel --no-link |
Builds cleanly. |
| Compositor Status | niri msg version |
Reports running Niri version. |
| DMS Shell Daemon | systemctl --user status dms.service |
Active (running). |
| Desktop Search | systemctl --user status dsearch.service |
Active (running) on port 43654. |