A script that automatically activates ASPM for all supported devices on Linux
- Python 61.6%
- Nix 38.4%
| modules | ||
| pkgs | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| README.md | ||
AutoASPM
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).
Dependencies
pciutilspython3which
Usage
NixOS - Run once
sudo nix run git+https://git.notthebe.ee/notthebee/AutoASPM
NixOS - Install permanently
- Add this repository to your flake.nix:
{
inputs.autoaspm = {
url = "git+https://git.notthebe.ee/notthebee/AutoASPM";
# 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
Other Linux distributions
-
Clone this repository
-
Run
sudo ./pkgs/autoaspm.py
Credits
- 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