waybar: Make temperature module input path configurable

This commit is contained in:
Erwin Boskma 2024-10-02 11:35:33 +02:00
parent 83c0196bf3
commit c332c4a78b
Signed by: erwin
SSH key fingerprint: SHA256:OCinH/khuGY1LA9RG8YLM8GNH6C1DDXBdy3SNE+I5Hw
2 changed files with 8 additions and 2 deletions

View file

@ -13,6 +13,11 @@ in
enable = mkEnableOption "Enable waybar"; enable = mkEnableOption "Enable waybar";
sway = mkEnableOption "sway"; sway = mkEnableOption "sway";
river = mkEnableOption "river"; river = mkEnableOption "river";
cpuTempPath = mkOption {
description = "The path to the CPU temperature sensor in sysfs";
type = types.path;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -168,7 +173,7 @@ in
}; };
"temperature" = { "temperature" = {
hwmon-path = "/sys/class/hwmon/hwmon2/temp1_input"; hwmon-path = cfg.cpuTempPath;
critical-threshold = 80; critical-threshold = 80;
interval = 5; interval = 5;
format = "{icon} {temperatureC}°C"; format = "{icon} {temperatureC}°C";

View file

@ -66,7 +66,7 @@ in
foot = { foot = {
enable = true; enable = true;
server = false; server = false;
fontSize = 12; fontSize = 16;
}; };
git = { git = {
enable = true; enable = true;
@ -166,6 +166,7 @@ in
waybar = { waybar = {
enable = true; enable = true;
sway = true; sway = true;
cpuTempPath = "/sys/class/hwmon/hwmon1/temp2_input";
}; };
}; };
services = { services = {