From 46e25b8d440ba5206381e6396decc25237e204e6 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 9 Mar 2026 15:41:31 +0100 Subject: [PATCH 1/4] srv-core: Install `it87` as kernel module --- hosts/srv-core/hardware.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/srv-core/hardware.nix b/hosts/srv-core/hardware.nix index 94aca3a..b418ddc 100644 --- a/hosts/srv-core/hardware.nix +++ b/hosts/srv-core/hardware.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ config, inputs, ... }: { imports = [ inputs.nixos-hardware.nixosModules.hardkernel-odroid-h4 ]; @@ -10,6 +10,7 @@ "coretemp" "it87" ]; + extraModulePackages = [ config.boot.kernelPackages.it87 ]; initrd.availableKernelModules = [ "xhci_pci" "ahci" From ff9c7ec2694c9e4c0a6b27773abd9658974effb3 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 9 Mar 2026 16:08:23 +0100 Subject: [PATCH 2/4] srv-core: Attempt to enable PWM manual control --- hosts/srv-core/hardware.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/srv-core/hardware.nix b/hosts/srv-core/hardware.nix index b418ddc..9b268a5 100644 --- a/hosts/srv-core/hardware.nix +++ b/hosts/srv-core/hardware.nix @@ -11,6 +11,7 @@ "it87" ]; extraModulePackages = [ config.boot.kernelPackages.it87 ]; + extraModprobeConfig = "options it87 force_id=0x8613"; initrd.availableKernelModules = [ "xhci_pci" "ahci" From 5c2647ca560695f21b95edff2a0e905cb3040f6a Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 9 Mar 2026 17:16:42 +0100 Subject: [PATCH 3/4] srv-core: Install out of tree kernel module `it87` --- hosts/srv-core/hardware.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts/srv-core/hardware.nix b/hosts/srv-core/hardware.nix index 94aca3a..b418ddc 100644 --- a/hosts/srv-core/hardware.nix +++ b/hosts/srv-core/hardware.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ config, inputs, ... }: { imports = [ inputs.nixos-hardware.nixosModules.hardkernel-odroid-h4 ]; @@ -10,6 +10,7 @@ "coretemp" "it87" ]; + extraModulePackages = [ config.boot.kernelPackages.it87 ]; initrd.availableKernelModules = [ "xhci_pci" "ahci" From dc95d6fd776905634d5e7cca7bb35818c6cd0332 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Mon, 9 Mar 2026 17:17:14 +0100 Subject: [PATCH 4/4] srv-core: Add fancontrol --- hosts/srv-core/hardware.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/hosts/srv-core/hardware.nix b/hosts/srv-core/hardware.nix index b418ddc..3b0c9c8 100644 --- a/hosts/srv-core/hardware.nix +++ b/hosts/srv-core/hardware.nix @@ -42,4 +42,33 @@ }; }; }; + + # Ensure pwm2_enable is set to 2 (automatic) before fancontrol starts, + # because the IT8613E can't transition 0 -> 1 (manual) directly, + # but can do 2 -> 1 which fancontrol requires. + systemd.services.fancontrol-pwm-init = { + description = "Initialize IT8613E PWM mode for fancontrol"; + before = [ "fancontrol.service" ]; + requiredBy = [ "fancontrol.service" ]; + serviceConfig.Type = "oneshot"; + script = "echo 2 > /sys/devices/platform/it87.2608/hwmon/hwmon*/pwm2_enable"; + unitConfig.ConditionPathExists = "/sys/devices/platform/it87.2608"; + }; + + hardware.fancontrol = { + enable = true; + config = '' + INTERVAL=5 + DEVPATH=hwmon1=devices/platform/coretemp.0 hwmon2=devices/platform/it87.2608 + DEVNAME=hwmon1=coretemp hwmon2=it8613 + FCTEMPS=hwmon2/pwm2=hwmon1/temp1_input + FCFANS=hwmon2/pwm2=hwmon2/fan2_input + MINTEMP=hwmon2/pwm2=70 + MAXTEMP=hwmon2/pwm2=100 + MINSTART=hwmon2/pwm2=35 + MINSTOP=hwmon2/pwm2=25 + MINPWM=hwmon2/pwm2=0 + MAXPWM=hwmon2/pwm2=255 + ''; + }; }