nixpkgs/nixos/modules/tasks/powertop.nix
Linus Heckemann fadb906b2f powertop module: add kmod to path
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.
2017-10-07 21:48:50 +01:00

28 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";
};
};
};
};
}