diff --git a/machines/hitagi/hardware-configuration.nix b/machines/hitagi/hardware-configuration.nix index 5facfae..33ecf6b 100644 --- a/machines/hitagi/hardware-configuration.nix +++ b/machines/hitagi/hardware-configuration.nix @@ -6,8 +6,13 @@ ]; boot = { - kernelModules = [ "kvm-amd" ]; - extraModulePackages = [ ]; + # fan control configuration from https://gist.github.com/bakman2/e801f342aaa7cade62d7bd54fd3eabd8 + kernelModules = [ "kvm-amd" "it87" ]; + kernelParams = [ "acpi_enforce_resources=lax" ]; # allow it87 to load + extraModulePackages = with config.boot.kernelPackages; [ it87 ]; + extraModprobeConfig = '' + options it87 force_id=0x8688 + ''; loader = { grub.enable = false; systemd-boot.enable = true; @@ -98,4 +103,38 @@ Type = "oneshot"; }; }; + + sbruder.fancontrol = { + enable = true; + enableDefaultMapping = true; + fans = { + front = { + pwmFile = "/sys/class/hwmon/hwmon1/pwm4"; + rpmFile = "/sys/class/hwmon/hwmon1/fan4_input"; + pwmLineStart = 50; + neverStop = true; + }; + back = { + pwmFile = "/sys/class/hwmon/hwmon1/pwm2"; + rpmFile = "/sys/class/hwmon/hwmon1/fan2_input"; + }; + }; + sensors = { + cpu = { + file = "/sys/class/hwmon/hwmon2/temp3_input"; + min = 50; + max = 80; + }; + gpu = { + file = "/sys/class/hwmon/hwmon4/temp1_input"; + min = 50; + max = 70; + }; + nvme = { + file = "/sys/class/hwmon/hwmon0/temp1_input"; + min = 40; + max = 70; + }; + }; + }; }