Merge pull request #272314 from NickCao/ppd
nixos/power-profiles-daemon: add package option
This commit is contained in:
commit
38304747b0
1 changed files with 9 additions and 10 deletions
|
@ -1,10 +1,7 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.power-profiles-daemon;
|
||||
package = pkgs.power-profiles-daemon;
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -15,8 +12,8 @@ in
|
|||
|
||||
services.power-profiles-daemon = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = lib.mdDoc ''
|
||||
Whether to enable power-profiles-daemon, a DBus daemon that allows
|
||||
|
@ -24,6 +21,8 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
package = lib.mkPackageOption pkgs "power-profiles-daemon" { };
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -31,7 +30,7 @@ in
|
|||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
assertions = [
|
||||
{ assertion = !config.services.tlp.enable;
|
||||
|
@ -42,13 +41,13 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
environment.systemPackages = [ package ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
services.dbus.packages = [ package ];
|
||||
services.dbus.packages = [ cfg.package ];
|
||||
|
||||
services.udev.packages = [ package ];
|
||||
services.udev.packages = [ cfg.package ];
|
||||
|
||||
systemd.packages = [ package ];
|
||||
systemd.packages = [ cfg.package ];
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue