feat(wim): change some hardware settings for battery life
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-10 19:07:11 -05:00
parent 0b6a1d48f1
commit c5422e018e

View file

@ -8,12 +8,14 @@
imports = [(modulesPath + "/installer/scan/not-detected.nix")]; imports = [(modulesPath + "/installer/scan/not-detected.nix")];
boot = { boot = {
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_zen;
kernelModules = ["kvm-amd" "acpi_call"];
extraModulePackages = with config.boot.kernelPackages; [ kernelParams = ["amd_pstate=active"];
v4l2loopback kernelModules = ["amdgpu" "kvm-amd"];
acpi_call
]; # Zenpower for ryzen cpu monitoring
extraModulePackages = with config.boot.kernelPackages; [zenpower];
blacklistedKernelModules = ["k10temp"];
initrd = { initrd = {
availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"]; availableKernelModules = ["nvme" "xhci_pci" "usb_storage" "sd_mod"];
@ -59,10 +61,17 @@
hardware = { hardware = {
cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware; cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware;
sensor.iio.enable = true;
opengl.enable = true;
opengl.driSupport32Bit = true;
uinput.enable = true; uinput.enable = true;
sensor.iio.enable = true;
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages =
if pkgs ? rocmPackages.clr
then with pkgs.rocmPackages; [clr clr.icd]
else with pkgs; [rocm-opencl-icd rocm-opencl-runtime];
};
bluetooth = { bluetooth = {
enable = true; enable = true;
@ -76,13 +85,39 @@
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
qemu qemu
powertop
]; ];
# enable brightness control # enable brightness control
programs.light.enable = true; programs.light.enable = true;
services = { services = {
tlp.enable = true; xserver.videoDrivers = ["modesetting"];
tlp = {
enable = true;
settings = {
NMI_WATCHDOG = 0;
RADEON_DPM_PERF_LEVEL_ON_AC = "auto";
RADEON_DPM_PERF_LEVEL_ON_BAT = "low";
RADEON_DPM_STATE_ON_AC = "performance";
RADEON_DPM_STATE_ON_BAT = "battery";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 20;
};
};
power-profiles-daemon.enable = false;
udev.extraRules = udev.extraRules =
/* /*