nixos/services.thermald: remove with lib;
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.thermald;
|
||||
in
|
||||
@@ -9,24 +6,24 @@ in
|
||||
###### interface
|
||||
options = {
|
||||
services.thermald = {
|
||||
enable = mkEnableOption "thermald, the temperature management daemon";
|
||||
enable = lib.mkEnableOption "thermald, the temperature management daemon";
|
||||
|
||||
debug = mkOption {
|
||||
type = types.bool;
|
||||
debug = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable debug logging.
|
||||
'';
|
||||
};
|
||||
|
||||
ignoreCpuidCheck = mkOption {
|
||||
type = types.bool;
|
||||
ignoreCpuidCheck = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to ignore the cpuid check to allow running on unsupported platforms";
|
||||
};
|
||||
|
||||
configFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
configFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
description = ''
|
||||
The thermald manual configuration file.
|
||||
@@ -37,12 +34,12 @@ in
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkPackageOption pkgs "thermald" { };
|
||||
package = lib.mkPackageOption pkgs "thermald" { };
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.dbus.packages = [ cfg.package ];
|
||||
|
||||
systemd.services.thermald = {
|
||||
@@ -53,8 +50,8 @@ in
|
||||
ExecStart = ''
|
||||
${cfg.package}/sbin/thermald \
|
||||
--no-daemon \
|
||||
${optionalString cfg.debug "--loglevel=debug"} \
|
||||
${optionalString cfg.ignoreCpuidCheck "--ignore-cpuid-check"} \
|
||||
${lib.optionalString cfg.debug "--loglevel=debug"} \
|
||||
${lib.optionalString cfg.ignoreCpuidCheck "--ignore-cpuid-check"} \
|
||||
${if cfg.configFile != null then "--config-file ${cfg.configFile}" else "--adaptive"} \
|
||||
--dbus-enable
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user