laptop(battery): power saving is more aggresive now

This commit is contained in:
2026-01-02 01:33:48 +00:00
parent f0360d6bdb
commit 8a3c5e155a
3 changed files with 32 additions and 6 deletions

View File

@@ -104,6 +104,18 @@
gamescope = pkgs_gamescope.callPackage packageNix { };
}
)
(final: prev: {
# TODO remove once updated on nixpkgs
tlp = prev.tlp.overrideAttrs (old: rec {
version = "1.9.0";
src = prev.fetchFromGitHub {
owner = "linrunner";
repo = "TLP";
rev = version;
hash = "sha256-aM/4+cgtUe6qv3MNT4moXvNzqG5gKvwMbg14L8ifWlc=";
};
});
})
];
utils = nix-meow.lib.setup {
inherit (inputs) home-manager nixpkgs;

View File

@@ -6,10 +6,23 @@ in
services.tlp = {
enable = true;
settings = {
CPU_ENERGY_PERF_POLICY_ON_AC = "balance_performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_SAV = "power";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
PCIE_ASPM_ON_BAT = "powersave";
CPU_SCALING_GOVERNOR_ON_AC = "balanced";
PCIE_ASPM_ON_AC = "balanced";
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_BOOST_ON_SAV = 0;
CPU_HWP_DYN_BOOST_ON_AC = 1;
CPU_HWP_DYN_BOOST_ON_BAT = 0;
CPU_HWP_DYN_BOOST_ON_SAV = 0;
PLATFORM_PROFILE_ON_AC = "balanced";
PLATFORM_PROFILE_ON_BAT = "quiet";
PLATFORM_PROFILE_ON_SAV = "quiet";
START_CHARGE_THRESH_BAT0 = 40; # 40 and below it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
};
@@ -21,8 +34,8 @@ in
};
# boot.kernelParams = [ "mem_sleep_default=deep" ];
services.logind.settings.Login = {
HandleLidSwitch = "suspend-then-hibernate";
HandleLidSwitchExternalPower = "ignore";
HandleLidSwitch = "hibernate";
HandleLidSwitchExternalPower = "suspend";
HandleLidSwitchDocked = "ignore";
};
systemd.sleep.extraConfig = ''
@@ -33,6 +46,6 @@ in
# one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", "lock"
powerManagement = {
enable = true;
powertop.enable = true;
# powertop.enable = true;
};
}

View File

@@ -31,7 +31,8 @@ in
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_6_12; # Hibernate works on 6.12 but not on latest
# boot.kernelPackages = pkgs.linuxPackages_6_12; # Hibernate works on 6.12 but not on latest
boot.kernelPackages = pkgs.linuxPackages_zen; # Hibernate works on 6.12 but not on latest
networking.hostName = "doloro-nixos-laptop"; # Define your hostname.
security.rtkit.enable = true;
@@ -66,9 +67,9 @@ in
# https://github.com/intel/libvpl?tab=readme-ov-file#dispatcher-behavior-when-targeting-intel-gpus
extraPackages = with pkgs; [
vpl-gpu-rt
# intel-media-driver # VA-API (iHD) userspace
intel-media-driver # VA-API (iHD) userspace
# vpl-gpu-rt # oneVPL (QSV) runtime
# intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
intel-compute-runtime # OpenCL (NEO) + Level Zero for Arc/Xe
];
};
services.openssh = {