mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
90b6823373
We should wait until after `multi-user.target` is triggered to allow hardware to finish initializing, such as network devices and USB drives. This ensures `powertop --auto-tune` sets more tunables to "Good". Fixes #66820
29 lines
652 B
Nix
29 lines
652 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.powerManagement.powertop;
|
|
in {
|
|
###### interface
|
|
|
|
options.powerManagement.powertop.enable = mkEnableOption "powertop auto tuning on startup";
|
|
|
|
###### implementation
|
|
|
|
config = mkIf (cfg.enable) {
|
|
systemd.services = {
|
|
powertop = {
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "multi-user.target" ];
|
|
description = "Powertop tunings";
|
|
path = [ pkgs.kmod ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
RemainAfterExit = "yes";
|
|
ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|