Add T490 hardware configuration and docs

- modules/t490.nix: TLP power management, CPU throttling (throttled), S3 sleep,
  remote Nix builders (cluster), fwupd, fprintd, fprintd, Syncthing, Tailscale,
  Intel VA-API, TrackPoint sensitivity, PipeWire defaults
- flake.nix: add nixos-hardware input, import T490 module + nixos-hardware
- docs/T490-HARDWARE.md: WiFi variants, graphics, audio, fingerprint, sleep guide
- docs/T490-BATTERY.md: TLP config, threshold strategy, real-world battery numbers
- docs/T490-OFFLOADING.md: local vs cluster split, remote builder setup
- MIGRATION.md: add T490 post-install steps (fwupd, fprint, remote build key)
- README.md: reflect new module and docs structure
This commit is contained in:
Scott Scoble 2026-05-14 17:40:04 -07:00
parent 6df0a20265
commit 5051dfdc8c
7 changed files with 364 additions and 3 deletions

56
docs/T490-BATTERY.md Normal file
View file

@ -0,0 +1,56 @@
# T490 Battery Life
## Hardware Baseline
- **50 Wh** internal battery (3-cell)
- Panel draws ~4-5W at typical brightness
- CPU TDP-up 25W, TDP-down 10W
## Real-World Estimates
| Scenario | Runtime |
|---|---|
| Idle, screen off | 10-12 hours |
| Light work (terminal, notes) | 7-8 hours |
| Dev work (editor, browser, kubectl) | 5-6 hours |
| Browsing (10+ tabs, video) | 4-5 hours |
| Compiling / heavy CPU | 1.5-2 hours |
## TLP Configuration
`modules/t490.nix` configures:
- `powersave` governor on battery, `performance` on AC
- Turbo disabled on battery
- CPU capped at 40% max frequency on battery (~1.7 GHz)
- WiFi power saving on battery
- PCIe runtime PM (auto on battery)
- Intel GPU frequency limits (300-600 MHz on battery)
### Battery Health Thresholds
Lenovo Battery Team recommendations — configured in `modules/t490.nix`:
- **Start charging** below 40%
- **Stop charging** at 80%
- Thresholds persist in firmware (survive reboots without TLP)
This dramatically extends battery lifespan. Don't leave plugged in at 100% for days.
## CPU Throttling Fix
Intel Whiskey Lake CPUs have a bug where BD PROCHOT fires spuriously, locking the CPU at 400 MHz. The nixos-hardware T490 module enables `services.throttled` (erpalma/throttled) — this is mandatory.
**Skip thermald** — it conflicts with throttled. `services.thermald.enable = false` is set in `modules/t490.nix`.
## Additional Tweaks
- `pcie_aspm=force` — force PCIe power saving
- `i915.enable_rc6=7` — max GPU power saving
- `noatime,nodiratime` — reduce disk writes
- **zram swap** at 50% of RAM — faster, saves NVMe writes
## Quick Wins (No Config Needed)
- Lower screen brightness (40-60% is plenty — biggest power draw)
- Disable Bluetooth when not in use
- Use S3 deep sleep (not s2idle)
- Close unused browser tabs

63
docs/T490-HARDWARE.md Normal file
View file

@ -0,0 +1,63 @@
# T490 Hardware Compatibility
## WiFi
Two possible cards depending on SKU:
- **Intel Wireless-AC 9560** (CNVio, older) — firmware: `iwlwifi-9000-pu-b0-jf-b0-*.ucode`
- **Intel Wi-Fi 6 AX200** (M.2, discrete, newer) — firmware: `iwlwifi-cc-a0-*.ucode`
Both use `iwlwifi` and work out of the box. If AX200 scan fails after suspend, firmware version may be the culprit. The `modules/t490.nix` includes a resume hook that reloads the module.
## Graphics — Intel UHD 620 (Whiskey Lake)
Single iGPU. No NVIDIA. No Optimus. Ideal for Linux.
| Feature | Support |
|---|---|
| OpenGL 4.6 | Mesa Iris driver |
| Vulkan 1.3 | Mesa ANV driver |
| VA-API decode | H.264, H.265 8-bit, VP9 8+10-bit, MPEG-2, VC-1, VP8 |
| VA-API encode | H.264 only (no H.265) |
| DisplayPort over USB-C | Up to 4096×2304 @ 60Hz |
| HDMI 1.4b | Up to 4096×2304 @ 24Hz |
## Thunderbolt 3
One full-speed TB3 port (also USB-C PD). `services.hardware.bolt.enable = true` in `modules/t490.nix`. Lenovo TB3 Dock Gen 2 works — update dock firmware via fwupd.
## Fingerprint Reader — Synaptics 06cb:00bd
Works after firmware update. Steps:
1. `fwupdmgr refresh && fwupdmgr update` — flashes Prometheus firmware
2. `fprintd-enroll` — enroll fingerprints
3. Works for sudo, login, and screen unlock via PAM
Check: `lsusb | grep 06cb` should show `06cb:00bd`.
## Audio
Single Intel audio card (`8086:9dc8`) with 5 sub-devices (speaker + 4 HDMI/USB-C). The nixos-hardware T490 module provides a custom PulseAudio profile set that exposes all 5 sinks simultaneously.
## Sleep / Resume — Critical
The T490 supports S3 (deep sleep) and S0ix (s2idle, modern standby). Lenovo removed S3 from some BIOS versions.
**Check:**
```
cat /sys/power/mem_sleep
```
| Output | Status | Action |
|---|---|---|
| `s2idle [deep]` | S3 default | Good |
| `[s2idle] deep` | S3 exists but not default | Already fixed in `modules/t490.nix` (`mem_sleep_default=deep`) |
| `[s2idle]` | S3 missing | Troubleshoot below |
**If S3 is missing:**
1. BIOS → Config → Power → Sleep State → "Linux" (re-enables S3 on some versions)
2. Downgrade BIOS (pre-2020 versions have S3)
3. Use hibernation instead (more reliable than s2idle)
**Sleep battery drain:**
- S3 (deep): ~0.5%/hour (~8 days on a 50 Wh battery)
- s2idle: ~2-4%/hour (1-2 days)

49
docs/T490-OFFLOADING.md Normal file
View file

@ -0,0 +1,49 @@
# T490 Offloading Strategy
The k3s cluster (n97, n97-mini) handles CPU-bound work so the T490 stays cool and battery lasts longer.
## Local (T490)
Interactive, latency-sensitive, or IO-bound:
- Firefox (web apps, research)
- Terminal + shell (`ghostty` + `zellij`)
- Editor (`nvim`)
- `kubectl` / `k9s` (just API calls)
- `git` on small repos
- `nixos-rebuild switch` (builds go remote, CLI runs locally)
- SSH client
- Chat (Signal, Discord)
- Obsidian
- Image/document viewing
## Cluster
CPU-bound, batch, or service workloads:
- Heavy Nix derivations during `nixos-rebuild` → remote builders
- Go/Rust/C compilation → ssh/rsync build remotely
- Docker/OCI image builds → build where they run
- Package builds (CI) → Forgejo runners on cluster
- Data processing, ETL
- Kubeclaw agent operations
- Long-running services (Forgejo, registry, web services)
## Remote Nix Builders
Configured in `modules/t490.nix`:
```nix
nix.distributedBuilds = true;
nix.buildMachines = [
{ hostName = "n97-mini"; system = "x86_64-linux"; maxJobs = 4; ... }
{ hostName = "n97"; system = "x86_64-linux"; maxJobs = 4; ... }
];
```
**Setup:** `ssh-keygen -t ed25519 -f /root/.ssh/remote-build` on T490, copy pubkey to each builder.
**When it works:** `nixos-rebuild switch --flake .#laptop` ships heavy derivations to the cluster. The T490 only builds what must be local (bootloader, activation scripts).
## Dev Compilation Patterns
- **sshfs mount:** Edit locally, files live on cluster → build via SSH
- **rsync + remote build:** Push source, build, pull binary back
- **nix develop with builders:** `nix develop .#project --builders "ssh://n97-mini"`