1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-16 18:03:22 +00:00
nixpkgs/nixos/modules/tasks/powertop.nix

30 lines
652 B
Nix
Raw Normal View History

2017-04-15 13:36:10 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.powerManagement.powertop;
2017-04-15 13:36:10 +01:00
in {
###### interface
options.powerManagement.powertop.enable = mkEnableOption "powertop auto tuning on startup";
2017-04-15 13:36:10 +01:00
###### implementation
config = mkIf (cfg.enable) {
systemd.services = {
powertop = {
wantedBy = [ "multi-user.target" ];
after = [ "multi-user.target" ];
2017-04-15 13:36:10 +01:00
description = "Powertop tunings";
path = [ pkgs.kmod ];
2017-04-15 13:36:10 +01:00
serviceConfig = {
Type = "oneshot";
RemainAfterExit = "yes";
ExecStart = "${pkgs.powertop}/bin/powertop --auto-tune";
};
};
};
};
}