1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/nixos/modules/tasks/powertop.nix

28 lines
581 B
Nix
Raw Normal View History

2017-04-15 08:36:10 -04:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.powerManagement.powertop;
2017-04-15 08:36:10 -04:00
in {
###### interface
options.powerManagement.powertop.enable = mkEnableOption "powertop auto tuning on startup";
2017-04-15 08:36:10 -04:00
###### 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";
};
};
};
};
}