2026-06-04 15:22:07 +01:00
|
|
|
# ThinkPad T400 (NixOS). Shared laptop options live in ../../modules/laptop.nix;
|
2026-06-04 15:38:23 +01:00
|
|
|
# only host-specific settings are here. Install notes (boot variants, GPU,
|
|
|
|
|
# partitions): see ./README.md.
|
2026-06-10 16:26:44 +01:00
|
|
|
{ config, ... }:
|
2026-06-04 15:22:07 +01:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports = [
|
|
|
|
|
./hardware-configuration.nix
|
2026-06-04 15:35:31 +01:00
|
|
|
# Boot: import exactly ONE, matching the firmware currently flashed.
|
|
|
|
|
# Stock Lenovo BIOS and coreboot+SeaBIOS both use boot-bios.nix.
|
|
|
|
|
./boot-bios.nix
|
|
|
|
|
# ./boot-coreboot-grub.nix # coreboot with the GRUB payload (config-only GRUB)
|
|
|
|
|
# ./boot-coreboot-uefi.nix # coreboot with the Tianocore/edk2 UEFI payload
|
|
|
|
|
# # (systemd-boot; carries its own ESP mount)
|
2026-06-04 15:22:07 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
networking.hostName = "T400-NixOS";
|
|
|
|
|
|
|
|
|
|
console.font = "Lat2-Terminus16";
|
|
|
|
|
|
2026-06-10 14:56:58 +01:00
|
|
|
# Low-RAM host (4 GiB max): a compressed RAM swap reduces disk paging.
|
|
|
|
|
zramSwap.enable = true;
|
2026-06-04 15:22:07 +01:00
|
|
|
|
|
|
|
|
# This host accepts SSH, so open 22 (the firewall itself is enabled in
|
|
|
|
|
# laptop.nix with a default-deny policy).
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
|
|
|
|
|
2026-06-10 14:56:58 +01:00
|
|
|
# Intel Core 2 (Penryn) microcode. Redistributable firmware (enabled in
|
|
|
|
|
# workstation.nix) supplies the iwlwifi blobs (Intel WiFi Link 5100/5300) and
|
|
|
|
|
# the radeon firmware needed by the discrete GPU below.
|
2026-06-04 15:22:07 +01:00
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
|
|
2026-06-10 16:26:44 +01:00
|
|
|
# Battery longevity: cap charging to 75-80%. tlp itself comes from the
|
|
|
|
|
# nixos-hardware lenovo-thinkpad profile; tp_smapi supplies the threshold
|
|
|
|
|
# sysfs on this 2008-era ThinkPad (kernel-native natacpi is too new for it).
|
|
|
|
|
boot.kernelModules = [ "tp_smapi" ];
|
|
|
|
|
boot.extraModulePackages = [ config.boot.kernelPackages.tp_smapi ];
|
|
|
|
|
services.tlp.settings = {
|
|
|
|
|
START_CHARGE_THRESH_BAT0 = 75;
|
|
|
|
|
STOP_CHARGE_THRESH_BAT0 = 80;
|
|
|
|
|
};
|
|
|
|
|
|
2026-06-04 15:35:31 +01:00
|
|
|
# This T400 has the optional discrete GPU fitted: an ATI Mobility Radeon HD
|
|
|
|
|
# 3470 (RV620), driven by the open `radeon` KMS driver. Load it in the initrd
|
|
|
|
|
# for early modesetting (clean Sway/Wayland start); firmware comes from
|
|
|
|
|
# enableRedistributableFirmware above.
|
|
|
|
|
#
|
|
|
|
|
# The T400 has switchable graphics (this discrete GPU + the Intel GMA
|
|
|
|
|
# 4500MHD). Select "Discrete" in the firmware's graphics setting so only the
|
|
|
|
|
# ATI is live; if you instead run "Integrated", the Intel i915 driver takes
|
|
|
|
|
# over with no extra config and `radeon` simply stays idle.
|
|
|
|
|
boot.initrd.kernelModules = [ "radeon" ];
|
|
|
|
|
|
2026-06-04 15:22:07 +01:00
|
|
|
# See `man configuration.nix` / the stateVersion docs before changing.
|
|
|
|
|
system.stateVersion = "26.05";
|
|
|
|
|
}
|