1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-19 07:59:24 +03:00
nixpkgs/nixos/modules/services/hardware/thermald.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

60 lines
1.5 KiB
Nix
Raw Normal View History

2014-08-14 02:17:55 +02:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.thermald;
in
{
2014-08-14 02:17:55 +02:00
###### interface
options = {
services.thermald = {
enable = mkEnableOption (lib.mdDoc "thermald, the temperature management daemon");
debug = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to enable debug logging.
'';
};
2023-08-27 16:18:54 +02:00
ignoreCpuidCheck = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc "Whether to ignore the cpuid check to allow running on unsupported platforms";
};
configFile = mkOption {
type = types.nullOr types.path;
default = null;
description = lib.mdDoc "the thermald manual configuration file.";
};
package = mkPackageOption pkgs "thermald" { };
};
};
2014-08-14 02:17:55 +02:00
###### implementation
config = mkIf cfg.enable {
services.dbus.packages = [ cfg.package ];
2014-08-14 02:17:55 +02:00
systemd.services.thermald = {
description = "Thermal Daemon Service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
PrivateNetwork = true;
ExecStart = ''
${cfg.package}/sbin/thermald \
--no-daemon \
${optionalString cfg.debug "--loglevel=debug"} \
2023-08-27 16:18:54 +02:00
${optionalString cfg.ignoreCpuidCheck "--ignore-cpuid-check"} \
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \
--dbus-enable \
--adaptive
'';
};
2014-08-14 02:17:55 +02:00
};
};
}