1 { config, lib, pkgs, ... }:
3 cfg = config.services.thermald;
9 enable = lib.mkEnableOption "thermald, the temperature management daemon";
11 debug = lib.mkOption {
12 type = lib.types.bool;
15 Whether to enable debug logging.
19 ignoreCpuidCheck = lib.mkOption {
20 type = lib.types.bool;
22 description = "Whether to ignore the cpuid check to allow running on unsupported platforms";
25 configFile = lib.mkOption {
26 type = lib.types.nullOr lib.types.path;
29 The thermald manual configuration file.
31 Leave unspecified to run with the `--adaptive` flag instead which will have thermald use your computer's DPTF adaptive tables.
33 See `man thermald` for more information.
37 package = lib.mkPackageOption pkgs "thermald" { };
42 config = lib.mkIf cfg.enable {
43 services.dbus.packages = [ cfg.package ];
45 systemd.services.thermald = {
46 description = "Thermal Daemon Service";
47 wantedBy = [ "multi-user.target" ];
49 PrivateNetwork = true;
51 ${cfg.package}/sbin/thermald \
53 ${lib.optionalString cfg.debug "--loglevel=debug"} \
54 ${lib.optionalString cfg.ignoreCpuidCheck "--ignore-cpuid-check"} \
55 ${if cfg.configFile != null then "--config-file ${cfg.configFile}" else "--adaptive"} \