From ba0a640afd06deb62f88c93e9b4118036c1090fa Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 12 Jan 2023 21:18:37 +0200 Subject: [PATCH] fancontrol: restart service after suspend --- nixos/modules/services/hardware/fancontrol.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nixos/modules/services/hardware/fancontrol.nix b/nixos/modules/services/hardware/fancontrol.nix index e7eb8ebf92be..993c37b2364f 100644 --- a/nixos/modules/services/hardware/fancontrol.nix +++ b/nixos/modules/services/hardware/fancontrol.nix @@ -42,6 +42,13 @@ in ExecStart = "${pkgs.lm_sensors}/sbin/fancontrol ${configFile}"; }; }; + + # On some systems, the fancontrol service does not resume properly after sleep because the pwm status of the fans + # is not reset properly. Restarting the service fixes this, in accordance with https://github.com/lm-sensors/lm-sensors/issues/172. + powerManagement.resumeCommands = '' + systemctl restart fancontrol.service + ''; + }; meta.maintainers = [ maintainers.evils ];