mirror of
https://github.com/danbulant/dotfiles
synced 2026-05-20 21:08:41 +00:00
trying more powersaving things
This commit is contained in:
parent
1ffcdd1a78
commit
7febca0786
6 changed files with 116 additions and 5 deletions
|
|
@ -22,6 +22,7 @@ in
|
|||
./hardware-configuration.nix
|
||||
# /etc/nixos/cachix.nix
|
||||
];
|
||||
nyx.low-power.enable = true;
|
||||
|
||||
nixpkgs.config.permittedInsecurePackages = [
|
||||
"olm-3.2.16"
|
||||
|
|
@ -359,12 +360,13 @@ in
|
|||
nvidiaBusId = lib.mkForce "PCI:01:00:0";
|
||||
};
|
||||
};
|
||||
hardware.enableAllFirmware = true;
|
||||
services.cpupower-gui.enable = true;
|
||||
services.upower.enable = true;
|
||||
services.power-profiles-daemon.enable = false;
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
USB_DENYLIST = "04d9:a0b8";
|
||||
# USB_DENYLIST = "04d9:a0b8";
|
||||
};
|
||||
# powerManagement.powertop.enable = true;
|
||||
# powerManagement.cpuFreqGovernor = "powersave";
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
./configuration.nix
|
||||
nix-index-database.nixosModules.nix-index
|
||||
{ programs.nix-index-database.comma.enable = true; }
|
||||
./powersave.nix
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,3 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
|
|
|
|||
3
home.nix
3
home.nix
|
|
@ -1,4 +1,4 @@
|
|||
{ colmena, zen-browser, nix-gaming, nixpkgs-unstable,/* suyu, */hyprland-plugins/*, hyprland*/, ... }:
|
||||
{ colmena, zen-browser, nix-gaming, nixpkgs-unstable, /* suyu, */hyprland-plugins/*, hyprland*/, ... }:
|
||||
{ pkgs, inputs, ...}:
|
||||
let
|
||||
|
||||
|
|
@ -18,6 +18,7 @@ in
|
|||
stateVersion = "24.05";
|
||||
|
||||
packages = with pkgs; [
|
||||
postgresql
|
||||
upower
|
||||
usbutils
|
||||
killall
|
||||
|
|
|
|||
109
powersave.nix
Normal file
109
powersave.nix
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
|
||||
{ inputs, config, lib, pkgs, nixos-hardware, ... }:
|
||||
{
|
||||
options = {
|
||||
nyx.low-power.enable =
|
||||
lib.mkEnableOption "enables low profile optimizations to reduce watt use";
|
||||
};
|
||||
imports = [
|
||||
nixos-hardware.nixosModules.common-gpu-nvidia-disable
|
||||
];
|
||||
config = lib.mkIf config.nyx.low-power.enable {
|
||||
boot = {
|
||||
kernelParams = [
|
||||
"pcie_aspm.policy=powersupersave"
|
||||
"amd_pstate=passive"
|
||||
"mitigations=auto"
|
||||
];
|
||||
|
||||
extraModprobeConfig = ''
|
||||
# AMD iGPU tuning
|
||||
options amdgpu dc=1
|
||||
options amdgpu deep_color=1
|
||||
options amdgpu aspm=1
|
||||
# Force dGPU off by default to save power (only use when explicitly requested)
|
||||
options amdgpu runpm=1
|
||||
'';
|
||||
};
|
||||
|
||||
networking.networkmanager.wifi.powersave = true;
|
||||
programs.sway.xwayland.enable = false;
|
||||
services.pipewire.jack.enable = false;
|
||||
powerManagement.enable = true;
|
||||
powerManagement.cpuFreqGovernor = "schedutil";
|
||||
# powerManagement.cpuFreqGovernor = "powersave";
|
||||
services.power-profiles-daemon.enable = false;
|
||||
|
||||
services.auto-cpufreq = {
|
||||
enable = true;
|
||||
settings = {
|
||||
battery = {
|
||||
governor = "powersave";
|
||||
turbo = "never";
|
||||
};
|
||||
charger = {
|
||||
governor = "powersave";
|
||||
turbo = "auto";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
TLP_DEFAULT_MODE = "BAT";
|
||||
CPU_SCALING_GOVERNOR_ON_AC = "schedutil";
|
||||
CPU_SCALING_GOVERNOR_ON_BAT = "schedutil";
|
||||
CPU_ENERGY_PERF_POLICY_ON_AC = "balance_power";
|
||||
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
|
||||
PCIE_ASPM_ON_AC = "default";
|
||||
PCIE_ASPM_ON_BAT = "powersupersave";
|
||||
RUNTIME_PM_ON_AC = "auto";
|
||||
RUNTIME_PM_ON_BAT = "auto";
|
||||
USB_AUTOSUSPEND = "1";
|
||||
WIFI_PWR_ON_AC = "on";
|
||||
WIFI_PWR_ON_BAT = "on";
|
||||
DEVICES_TO_DISABLE_ON_BAT = "bluetooth";
|
||||
DEVICES_TO_DISABLE_ON_STARTUP = "bluetooth";
|
||||
DISK_IDLE_SECS_ON_AC = "60";
|
||||
DISK_IDLE_SECS_ON_BAT = "30";
|
||||
SATA_LINKPWR_ON_AC = "med_power_with_dipm";
|
||||
SATA_LINKPWR_ON_BAT = "min_power";
|
||||
SOUND_POWER_SAVE_ON_AC = "1";
|
||||
SOUND_POWER_SAVE_ON_BAT = "1";
|
||||
PLATFORM_PROFILE_ON_AC = "balanced";
|
||||
PLATFORM_PROFILE_ON_BAT = "low-power";
|
||||
};
|
||||
};
|
||||
powerManagement.powertop.enable = true;
|
||||
services.thermald.enable = true;
|
||||
|
||||
hardware = {
|
||||
opengl = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [ mesa ];
|
||||
};
|
||||
amdgpu.overdrive.enable = lib.mkForce false;
|
||||
};
|
||||
|
||||
services.printing.enable = lib.mkForce false;
|
||||
hardware.bluetooth.enable = lib.mkForce false;
|
||||
services.avahi.enable = lib.mkForce false;
|
||||
services.fwupd.enable = true;
|
||||
services.locate.enable = false;
|
||||
services.openssh.enable = lib.mkForce false;
|
||||
programs.java.enable = lib.mkForce false;
|
||||
services.upower.enable = lib.mkForce false;
|
||||
services = {
|
||||
xserver.windowManager.fvwm2.gestures = lib.mkForce false;
|
||||
libinput.enable = lib.mkForce false;
|
||||
};
|
||||
hardware.opentabletdriver.enable = lib.mkForce false;
|
||||
programs.kdeconnect.enable = lib.mkForce false;
|
||||
|
||||
virtualisation = {
|
||||
# docker.enable = lib.mkForce false;
|
||||
libvirtd.enable = lib.mkForce false;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -116,6 +116,7 @@ in
|
|||
enable = true;
|
||||
settings.server.http_port = ports.grafana;
|
||||
};
|
||||
prometheus.enable = true;
|
||||
|
||||
gitea = {
|
||||
enable = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue