Added cfg values

This commit is contained in:
ari committed 2024-07-31 14:45:29 -04:00
1 parent eba5869d86
commit 144a822090
2 files changed
+21 -3

No files matched your search

+17 -2
View File
@@ -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;
}
+4 -1
View File
@@ -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";
};
};