# modules/hosts/laptop/uniwill-laptop.nix## fan-throttle-guard.nix expects the in-tree `uniwill-laptop` driver (the# `uniwill` hwmon: fan1/fan2 rpm, pwm1/pwm2, board temps; also the keyboard# backlight LED and the touchpad-toggle bit padx mentions). Upstream merged it# in Linux 6.19; the nixpkgs 6.18 kernel predates it and the 7.2 kernel config# leaves X86_PLATFORM_DRIVERS_UNIWILL off. Building the v6.19 sources as an# out-of-tree module against whatever boot.kernelPackages selects is the cheap# fix: a 10-second compile, no custom kernel. Verified to build on 6.18.55.## Without this hwmon stability_guard.py pins the CPU at 1.8 GHz ("essential# sensor or main fan unavailable"), so this file is not optional.{ ... }:
{
flake.nixosModules.laptop-uniwill= { config, lib, pkgs, ... }:
{
boot.extraModulePackages= [
(config.boot.kernelPackages.callPackage ./uniwill-laptop/_package.nix { })
];
# `boot.kernelModules` and the `force=1` modprobe option (this GM7RGxM is not# in the driver's DMI list) are set in fan-throttle-guard.nix. }
;
}