mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-04 01:42:53 +03:00
fancontrol service init
This commit is contained in:
parent
5426932f7c
commit
81b6dec3c8
@ -328,6 +328,7 @@
|
||||
./services/hardware/bluetooth.nix
|
||||
./services/hardware/bolt.nix
|
||||
./services/hardware/brltty.nix
|
||||
./services/hardware/fancontrol.nix
|
||||
./services/hardware/freefall.nix
|
||||
./services/hardware/fwupd.nix
|
||||
./services/hardware/illum.nix
|
||||
|
39
nixos/modules/services/hardware/fancontrol.nix
Normal file
39
nixos/modules/services/hardware/fancontrol.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.fancontrol;
|
||||
|
||||
in {
|
||||
|
||||
options.services.fancontrol = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
example = true;
|
||||
description = "Whether to enable fancontrol (requires a configuration file, see pwmconfig)";
|
||||
};
|
||||
|
||||
configFile = mkOption {
|
||||
type = types.str;
|
||||
default = "/etc/fancontrol";
|
||||
example = "/home/user/.config/fancontrol";
|
||||
description = "Path to the configuration file, likely generated with pwmconfig.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.fancontrol = {
|
||||
description = "Fan speed control from lm_sensors";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
User = "root";
|
||||
ExecStart = "${pkgs.lm_sensors}/bin/fancontrol ${cfg.configFile}";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user