mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2026-02-22 12:55:13 +08:00
feat: set new power profiles; move displaylink to laptop role as it is wasted cpu usage on desktops
This commit is contained in:
parent
8a3163660e
commit
576a8a3780
1 changed files with 23 additions and 5 deletions
|
|
@ -30,11 +30,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
# DisplayLink
|
# DisplayLink
|
||||||
services.xserver.videoDrivers = [
|
import = [ (../modules/core/displaylink.nix) ];
|
||||||
"displaylink"
|
|
||||||
"modesetting"
|
|
||||||
];
|
|
||||||
systemd.services.dlm.wantedBy = [ "multi-user.target" ];
|
|
||||||
|
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
|
@ -48,6 +44,13 @@ in
|
||||||
thermald.enable = true;
|
thermald.enable = true;
|
||||||
power-profiles-daemon.enable = true;
|
power-profiles-daemon.enable = true;
|
||||||
|
|
||||||
|
udev.extraRules = ''
|
||||||
|
# Switch to power-save profile when on battery
|
||||||
|
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set power-saver", RUN+="/bin/sh -c 'echo 30 | tee /sys/class/backlight/amdgpu_bl1/brightness'"
|
||||||
|
# Switch to balanced profile when plugged in
|
||||||
|
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="${pkgs.power-profiles-daemon}/bin/powerprofilesctl set balanced", RUN+="/bin/sh -c 'cat /sys/class/backlight/amdgpu_bl1/max_brightness > /sys/class/backlight/amdgpu_bl1/brightness'"
|
||||||
|
'';
|
||||||
|
|
||||||
upower = {
|
upower = {
|
||||||
enable = true;
|
enable = true;
|
||||||
percentageLow = 20;
|
percentageLow = 20;
|
||||||
|
|
@ -55,6 +58,21 @@ in
|
||||||
percentageAction = 5;
|
percentageAction = 5;
|
||||||
criticalPowerAction = "Hibernate";
|
criticalPowerAction = "Hibernate";
|
||||||
};
|
};
|
||||||
|
#auto-cpufreq = {
|
||||||
|
# enable = true;
|
||||||
|
# settings = {
|
||||||
|
# battery = {
|
||||||
|
# governor = "powersave";
|
||||||
|
# turbo = "never";
|
||||||
|
# energy_performance_preference = "balance_power";
|
||||||
|
# };
|
||||||
|
# charger = {
|
||||||
|
# governor = "performance";
|
||||||
|
# turbo = "auto";
|
||||||
|
# energy_performance_preference = "performance";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#};
|
||||||
};
|
};
|
||||||
# powerManagement.powertop.enable = false; # somehow figure out how to let this not apply to specific USB devices, as they will auto suspend and that is annoying.
|
# powerManagement.powertop.enable = false; # somehow figure out how to let this not apply to specific USB devices, as they will auto suspend and that is annoying.
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue