A Python script that automatically activates ASPM for all supported devices on Linux.
It parses the lspci -vv output to determine which ASPM level is supported by
a device (e.g. L0s, L0sL1 or L1).
pciutilspython3which
sudo nix run github:notthebee/AutoASPM- Add this repository to your flake.nix:
{
inputs.autoaspm = {
url = "github:notthebee/AutoASPM?shallow=true";
# NOTE: optionally your flake's `nixpkgs`
# inputs.nixpkgs.follows = "nixpkgs";
};
# ...
}- Import the AutoASPM Nix module in your
nixosConfiguration(assuming access to your flake'sinputsas aspecialArg):
{ inputs, pkgs, lib, ... }:
{
imports = [
inputs.autoaspm.nixosModules.default
];
# ...
}- Enable the AutoASPM service in your configuration:
{
# ...
services.autoaspm.enable = true;
}- ???
- Profit
-
Clone this repository
-
Run
sudo ./pkgs/autoaspm.py
- Luis R. Rodriguez for writing the original enable_aspm script: https://www.uwsg.indiana.edu/hypermail/linux/kernel/1006.2/02177.html
- z8 for his Python rewrite of the enable_aspm script: https://github.com/0x666690/ASPM