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