depot/third_party/nixpkgs/nixos/modules/services/hardware/power-profiles-daemon.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

54 lines
1 KiB
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.services.power-profiles-daemon;
in
{
###### interface
options = {
services.power-profiles-daemon = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = lib.mdDoc ''
Whether to enable power-profiles-daemon, a DBus daemon that allows
changing system behavior based upon user-selected power profiles.
'';
};
package = lib.mkPackageOption pkgs "power-profiles-daemon" { };
};
};
###### implementation
config = lib.mkIf cfg.enable {
assertions = [
{ assertion = !config.services.tlp.enable;
message = ''
You have set services.power-profiles-daemon.enable = true;
which conflicts with services.tlp.enable = true;
'';
}
];
environment.systemPackages = [ cfg.package ];
services.dbus.packages = [ cfg.package ];
services.udev.packages = [ cfg.package ];
systemd.packages = [ cfg.package ];
};
}