mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 21:21:06 +00:00
0412bde942
Add missing type information to manually specified enable options or replace them by mkEnableOption where appropriate.
48 lines
1.1 KiB
Nix
48 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.thermald;
|
|
in {
|
|
###### interface
|
|
options = {
|
|
services.thermald = {
|
|
enable = mkEnableOption "thermald, the temperature management daemon";
|
|
|
|
debug = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = ''
|
|
Whether to enable debug logging.
|
|
'';
|
|
};
|
|
|
|
configFile = mkOption {
|
|
type = types.nullOr types.path;
|
|
default = null;
|
|
description = "the thermald manual configuration file.";
|
|
};
|
|
};
|
|
};
|
|
|
|
###### implementation
|
|
config = mkIf cfg.enable {
|
|
services.dbus.packages = [ pkgs.thermald ];
|
|
|
|
systemd.services.thermald = {
|
|
description = "Thermal Daemon Service";
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
ExecStart = ''
|
|
${pkgs.thermald}/sbin/thermald \
|
|
--no-daemon \
|
|
${optionalString cfg.debug "--loglevel=debug"} \
|
|
${optionalString (cfg.configFile != null) "--config-file ${cfg.configFile}"} \
|
|
--dbus-enable
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|