Host Configurations
This section documents host-specific machine configurations within the fleet. Each subdirectory under hosts/ represents an individual physical system declared in outputs.nix.
[!NOTE] Shared modules—including Sunshine streaming with zero-touch tablet display, Hyprland, gaming, and shell scripts—are enabled by default across all fleet machines via
outputs.nix. The table below highlights host-specific roles, hardware specifications, and quirks.
Active Fleet Inventory
| Host | Role | Hardware Specs | Boot & Storage | Key Modules & Hardware Quirks |
|---|---|---|---|---|
framework16 | Primary Workstation Laptop | Framework Laptop 16 (AMD Ryzen 7840HS, 96GB RAM) | LUKS (TPM2 auto-unlock), Lanzaboote Secure Boot, Btrfs with 100GB hibernation swap (/.swapvol) | QMK keyboard backlight manager (kb-light-manager), laptop power management (modules/laptop), nixos-hardware integration |
mini-pc-k8 | HTPC / Living Room Workstation | GMKtec NucBox K8 Plus (AMD Ryzen 8845HS, 64GB RAM) | Unencrypted Btrfs, 8GB swap | Harmonia local binary cache (services.harmonia.cache), custom ALSA card profile (k8-plus-analog.conf), Intel Bluetooth de-authorization (8087:0029), Flatpak auto-discovery |
Host Directory Structure
Every host directory follows a standardized, modular layout:
hosts/<hostname>/├── default.nix # Primary entrypoint imported by outputs.nix├── hardware-configuration.nix # Kernel modules and drivers (auto-generated)├── disko.nix # Partition scheme, filesystems, and encryption├── config.nix # (Optional) Host-specific toggles, quirks, and secrets├── flatpak.nix # (Optional) Host Flatpak packages (auto-imported)└── home/ # (Optional) Per-host Home Manager overrides └── default.nixFile Responsibilities
-
default.nix: The primary NixOS configuration entrypoint for the host. Importsdisko.nix,hardware-configuration.nix, and optionallyconfig.nix. -
hardware-configuration.nix: Auto-generated bynixos-generate-configor duringinstall.sh.[!WARNING] Never edit this file manually. Linter warnings inside auto-generated hardware configuration files are ignored by convention.
-
disko.nix: Defines the complete disk lifecycle:- Partition tables (GPT, ESP
/boot). - Disk encryption (LUKS containers and TPM2 auto-unlock via
crypttabExtraOpts). - Filesystem formatting and subvolumes (Btrfs root, home, nix, swap).
- Storage maintenance timers (
services.btrfs.autoScrub).
- Partition tables (GPT, ESP
-
config.nix(Optional): A consolidated module for machine-specific option toggles, hardware workarounds, and host-specific secrets (age.secrets). For example, inmini-pc-k8, this file configures the Realtek audio workaround and disables conflicting onboard Bluetooth controllers. -
flatpak.nix(Optional): A dedicated list of machine-specific Flatpak packages and sandbox overrides, automatically discovered and imported bymodules/flatpak/if present. -
home/(Optional): Host-specific user packages or environment settings. Automatically imported into the user’s Home Manager environment bymodules/home-manager/.
Declaring Hosts in outputs.nix
Every host is wired into the system build via the hosts attribute set in outputs.nix:
<hostname> = { username = "<user_name>"; system = "x86_64-linux";
extraModules = [ # Host-specific NixOS system modules (e.g. nixos-hardware, laptop, desktop) ];};Conventions & Best Practices
- No Hardcoded UIDs/Paths: Always use the dynamic
usernamevariable and theusersgroup. Never hardcode/home/usernameor numerical UIDs. - Strict Separation of Concerns: Generic or reusable capabilities belong in
modules/orhome/. Only true hardware-specific quirks or host-unique settings belong inhosts/<hostname>/. - Minimal Diff Churn: Keep host configuration focused and avoid moving or refactoring unrelated blocks during host maintenance.