2024-09-09 00:22:14 +00:00
|
|
|
{
|
2024-09-13 01:50:53 +00:00
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib; let
|
|
|
|
cfg = config.custom.services.fw-fanctrl;
|
|
|
|
in {
|
|
|
|
options.custom.services.fw-fanctrl.enable = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
# https://github.com/TamtamHero/fw-fanctrl/tree/packaging/nix
|
|
|
|
programs.fw-fanctrl = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
# https://github.com/TamtamHero/fw-fanctrl/blob/packaging/nix/config.json
|
|
|
|
#?? fw-fanctrl --reload
|
|
|
|
config = {
|
|
|
|
defaultStrategy = "custom";
|
|
|
|
|
|
|
|
strategies.custom = {
|
|
|
|
fanSpeedUpdateFrequency = 3; # Seconds
|
|
|
|
movingAverageInterval = 30; # Seconds
|
2024-09-13 01:50:53 +00:00
|
|
|
speedCurve = let
|
|
|
|
curve = temp: speed: {inherit temp speed;};
|
|
|
|
in [
|
|
|
|
(curve 0 0)
|
|
|
|
(curve 40 20)
|
|
|
|
(curve 50 30)
|
|
|
|
(curve 60 40)
|
|
|
|
(curve 70 50)
|
|
|
|
#!! Max fan speed of 50%
|
|
|
|
];
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|