mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 09:04:17 +00:00
ef176dcf7e
conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.thermald;
|
|
in
|
|
{
|
|
###### 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.
|
|
'';
|
|
};
|
|
|
|
configFile = mkOption {
|
|
type = types.nullOr types.path;
|
|
default = null;
|
|
description = lib.mdDoc "the thermald manual configuration file.";
|
|
};
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.thermald;
|
|
defaultText = literalExpression "pkgs.thermald";
|
|
description = lib.mdDoc "Which thermald package to use.";
|
|
};
|
|
};
|
|
};
|
|
|
|
###### implementation
|
|
config = mkIf cfg.enable {
|
|
services.dbus.packages = [ cfg.package ];
|
|
|
|
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"} \
|
|
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \
|
|
--dbus-enable \
|
|
--adaptive
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|