diff --git a/hosts/hl-terra1.nix b/hosts/hl-terra1.nix index 3a29520..db663dc 100644 --- a/hosts/hl-terra1.nix +++ b/hosts/hl-terra1.nix @@ -1,12 +1,27 @@ { user }: -{ pkgs, lib, config, ... }: { +{ pkgs, lib, config, ... }: +let + fanCfgFile = pkgs.writeText "/etc/fancontrol" ''INTERVAL=10 +DEVPATH=hwmon0=devices/platform/coretemp.0 hwmon1=devices/platform/it87.2592 +DEVNAME=hwmon0=coretemp hwmon1=it8613 +FCTEMPS=hwmon1/pwm3=hwmon0/temp1_input +FCFANS= hwmon1/pwm3=hwmon1/fan3_input +MINTEMP=hwmon1/pwm3=20 +MAXTEMP=hwmon1/pwm3=60 +MINSTART=hwmon1/pwm3=52 +MINSTOP=hwmon1/pwm3=12''; +in +{ imports = [ ./hl-terra1.hardware-configuration.nix ]; # firmware updater services.fwupd.enable = true; # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; - homelab.hardware.fan2go.enable = true; + homelab.hardware.fancontrol = { + enable = true; + configName = fanCfgFile; + }; homelab.nix.remote-builder.enable = true; } diff --git a/modules/hl-hardware/fancontrol.nix b/modules/hl-hardware/fancontrol.nix index 81dfc3e..37b4a24 100644 --- a/modules/hl-hardware/fancontrol.nix +++ b/modules/hl-hardware/fancontrol.nix @@ -9,6 +9,9 @@ in { options.homelab.hardware.fancontrol = with lib; { enable = mkEnableOption "fancontrol"; + configName = mkOption { + type = types.str; + }; }; config = lib.mkIf cfg.enable { @@ -22,7 +25,7 @@ in }; serviceConfig = { - ExecStart = "${pkgs.lm_sensors}/bin/fancontrol"; + ExecStart = "${pkgs.lm_sensors}/bin/fancontrol ${cfg.configName}"; Restart = "always"; }; };