mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Laptop] Add option to force PCIe ASPM
This commit is contained in:
parent
fb0b741ea1
commit
5cda91672c
3 changed files with 325 additions and 0 deletions
20
laptop.nix
20
laptop.nix
|
|
@ -16,6 +16,9 @@ in {
|
|||
description = "Change service used to manage power consumption on laptop";
|
||||
type = types.enum [ "tlp" "power-profiles-daemon" false ];
|
||||
};
|
||||
tweaks = {
|
||||
pcieAspmForce = mkEnableOption "hardcore tweaks to power consumption. Warning: Might be dangerous to use.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -31,6 +34,23 @@ in {
|
|||
# Les power consumption against some performance
|
||||
"workqueue.power_efficient" = "";
|
||||
nohz = "on";
|
||||
|
||||
pcie_aspm = mkIf cfg.tweaks.pcieAspmForce "force";
|
||||
};
|
||||
|
||||
|
||||
systemd.services.aspm-force-enable = let
|
||||
aspm_enable = pkgs.callPackage ./packages/aspm_enable { };
|
||||
in {
|
||||
serviceConfig = {
|
||||
ExecStart = [
|
||||
"${aspm_enable}/bin/aspm_enable"
|
||||
];
|
||||
Type = "simple";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "Force-enable PCIe ASPM";
|
||||
enable = cfg.tweaks.pcieAspmForce;
|
||||
};
|
||||
|
||||
services.tlp.enable = (cfg.power-manager == "tlp");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue