diff options
author | Jörg Thalheim <joerg@thalheim.io> | 2017-04-15 14:36:10 +0200 |
---|---|---|
committer | Jörg Thalheim <joerg@thalheim.io> | 2017-04-15 15:17:02 +0200 |
commit | b9d9083322add2026935898d5a372a3a2464e92e (patch) | |
tree | c7c331ab95fba8282c4ca7113f6ff2b15acf6750 /nixos/modules/tasks/powertop.nix | |
parent | 26f5fa8f974aba0c08376e995deb8c50aff48727 (diff) |
powertop: add module
Diffstat (limited to 'nixos/modules/tasks/powertop.nix')
-rw-r--r-- | nixos/modules/tasks/powertop.nix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/nixos/modules/tasks/powertop.nix b/nixos/modules/tasks/powertop.nix new file mode 100644 index 000000000000..6f57f5f5c25e --- /dev/null +++ b/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"; + }; + }; + }; + }; +} |