Added specific configs from arnarg/config
This commit is contained in:
1 parent
b313d7a4f8
commit
b80f189128
5 files changed
+150
-32
No files matched your search
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./fan2go.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
# Source: https://github.com/arnarg/config/blob/3cfad29004a92d310871a56605aa84df1b13741f/hosts/terra/fan2go.nix
|
||||
{ lib
|
||||
, config
|
||||
, pkgs
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
cfg = config.homelab.hardware.fan2go;
|
||||
|
||||
fan2goConfig = pkgs.writeText "fan2go.yaml" ''
|
||||
dbPath: ${cfg.dbPath}
|
||||
|
||||
fans:
|
||||
- id: out_back
|
||||
hwmon:
|
||||
platform: it8613
|
||||
rpmChannel: 3
|
||||
pwmChannel: 3
|
||||
curve: case_max
|
||||
|
||||
sensors:
|
||||
- id: cpu_package
|
||||
hwmon:
|
||||
platform: coretemp
|
||||
index: 1
|
||||
|
||||
- id: nvme_ssd
|
||||
hwmon:
|
||||
platform: nvme
|
||||
index: 2
|
||||
|
||||
- id: hdd
|
||||
hwmon:
|
||||
platform: drivetemp
|
||||
index: 1
|
||||
|
||||
curves:
|
||||
- id: cpu_curve
|
||||
linear:
|
||||
sensor: cpu_package
|
||||
steps:
|
||||
- 40: 0
|
||||
- 50: 50
|
||||
- 80: 255
|
||||
|
||||
- id: nvme_curve
|
||||
linear:
|
||||
sensor: nvme_ssd
|
||||
min: 40
|
||||
max: 70
|
||||
|
||||
- id: hdd_curve
|
||||
linear:
|
||||
sensor: hdd
|
||||
min: 30
|
||||
max: 50
|
||||
|
||||
- id: case_max
|
||||
function:
|
||||
type: maximum
|
||||
curves:
|
||||
- cpu_curve
|
||||
- nvme_curve
|
||||
- hdd_curve
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.homelab.hardware.fan2go = with lib; {
|
||||
enable = mkEnableOption "fan2go";
|
||||
|
||||
dbPath = mkOption {
|
||||
type = types.str;
|
||||
default = "/var/lib/fan2go/fan2go.db";
|
||||
description = "The path of the database file.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.services.fan2go = {
|
||||
description = "A simple daemon providing dynamic fan speed control based on temperature sensors.";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "lm_sensors.service" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = lib.concatStringsSep " " [
|
||||
"${pkgs.fan2go}/bin/fan2go"
|
||||
"-c"
|
||||
"${fan2goConfig}"
|
||||
"--no-style"
|
||||
];
|
||||
LimitNOFILE = 8192;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
+3
-1
@@ -48,5 +48,7 @@
|
||||
else
|
||||
[ ])
|
||||
++ (if enableNetworkDrives then [ (import ./network-drives.nix) ] else [ ])
|
||||
++ (if enableHomelabServices then [ (import ./hl-services) ] else [ ]);
|
||||
++ (if enableHomelabServices then [ (import ./hl-services) ] else [ ])
|
||||
++ (if enableHomelabServices then [ (import ./hl-hardware) ] else [ ])
|
||||
;
|
||||
}
|
||||
Reference in new issue
Block a user