mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 04:46:43 +00:00
12bd55a1a3
auto-cpufreq is similar to tlp in that it shouldn't be run with power-profiles-daemon. There functionality can conflict and bugs can show up. On my system this materialized by auto-cpufreq frequently shutting down, but there may be other consequences. This change follows the same pattern as the tlp assertion
61 lines
1.2 KiB
Nix
61 lines
1.2 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 = ''
|
|
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;
|
|
'';
|
|
}
|
|
{ assertion = !config.services.auto-cpufreq.enable;
|
|
message = ''
|
|
You have set services.power-profiles-daemon.enable = true;
|
|
which conflicts with services.auto-cpufreq.enable = true;
|
|
'';
|
|
}
|
|
];
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
services.dbus.packages = [ cfg.package ];
|
|
|
|
services.udev.packages = [ cfg.package ];
|
|
|
|
systemd.packages = [ cfg.package ];
|
|
|
|
};
|
|
|
|
}
|