forked from mirrors/nixpkgs
fadb906b2f
powertop attempt to load some kernel modules like msr by calling
modprobe. This is the counterpart to
88e43eb39b
which has the powertop
executable search PATH for modprobe rather than hardcoding /sbin, and
actually adds the directory containing modprobe to its PATH for the
systemd service.
29 lines
611 B
Nix
29 lines
611 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" ];
|
|
description = "Powertop tunings";
|
|
path = [ pkgs.kmod ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
RemainAfterExit = "yes";
|
|
ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|