nixpkgs/nixos/modules/tasks/powertop.nix
2017-05-16 18:22:44 +02:00

28 lines
581 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";
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
};
};
};
};
}