Skip to content

Commit

Permalink
Merge pull request #24928 from Mic92/powertop
Browse files Browse the repository at this point in the history
powertop: add module
  • Loading branch information
Mic92 committed Apr 15, 2017
2 parents 26f5fa8 + b9d9083 commit 43c436a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -659,6 +659,7 @@
./tasks/scsi-link-power-management.nix
./tasks/swraid.nix
./tasks/trackpoint.nix
./tasks/powertop.nix
./testing/service-runner.nix
./virtualisation/container-config.nix
./virtualisation/containers.nix
Expand Down
27 changes: 27 additions & 0 deletions nixos/modules/tasks/powertop.nix
@@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.powerManagment.powertop;
in {
###### interface

options.powerManagment.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";
};
};
};
};
}

0 comments on commit 43c436a

Please sign in to comment.