39 lines
706 B
Nix
39 lines
706 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
{
|
|
services.thermald.enable = true;
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
lm_sensors
|
|
];
|
|
|
|
systemd.services.thermal-log = {
|
|
description = "Periodic thermal logging to journal";
|
|
serviceConfig.Type = "oneshot";
|
|
path = with pkgs; [
|
|
lm_sensors
|
|
gnugrep
|
|
coreutils
|
|
util-linux
|
|
];
|
|
script = ''
|
|
TEMP=$(sensors 2>/dev/null | grep -i 'Tctl\|Tdie' | head -1 || echo "N/A")
|
|
logger -t thermal-log "CPU Temp: $TEMP"
|
|
'';
|
|
};
|
|
|
|
systemd.timers.thermal-log = {
|
|
wantedBy = [ "timers.target" ];
|
|
timerConfig = {
|
|
OnBootSec = "5min";
|
|
OnUnitActiveSec = "5min";
|
|
Persistent = true;
|
|
};
|
|
};
|
|
}
|