diff --git a/.gitignore b/.gitignore index 92b2793..2bbdbfe 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .direnv +result diff --git a/flake.nix b/flake.nix index e456d9d..cabf269 100644 --- a/flake.nix +++ b/flake.nix @@ -64,7 +64,8 @@ in { nixosConfigurations = mkHostConfigs (readHosts "nixos"); - devShell.x86_64-linux = let pkgs = nixpkgs.legacyPackages.x86_64-linux; + devShell.x86_64-linux = let + pkgs = nixpkgs.legacyPackages.x86_64-linux; in pkgs.mkShell { buildInputs = with pkgs; [ nil lua-language-server ]; }; diff --git a/hosts/common/specialisations/powersave.nix b/hosts/common/specialisations/powersave.nix index bbbf826..630cdbf 100644 --- a/hosts/common/specialisations/powersave.nix +++ b/hosts/common/specialisations/powersave.nix @@ -2,6 +2,37 @@ { specialisation.powersave.configuration = { - powerManagement.cpuFreqGovernor = "powersave"; + services.power-profiles-daemon.enable = false; + + services.tlp = { + enable = true; + + settings = { + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + CPU_SCALING_GOVERNOR_ON_AC = "powersave"; + CPU_ENERGY_PREF_ON_BAT = "power"; + CPU_ENERGY_PREF_ON_AC = "power"; + + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 0; + + CPU_HWP_DYN_BOOST_ON_AC=1; + CPU_HWP_DYN_BOOST_ON_BAT=0; + + CPU_MIN_PERF_ON_BAT = 0; + CPU_MIN_PERF_ON_AC = 0; + CPU_MAX_PERF_ON_BAT = 20; + CPU_MAX_PERF_ON_AC = 100; + + AMDGPU_ABM_LEVEL_ON_AC=0; + AMDGPU_ABM_LEVEL_ON_BAT=3; + + PLATFORM_PROFILE_ON_AC="performance"; + PLATFORM_PROFILE_ON_BAT="low-power"; + + START_CHARGE_THRESH_BAT0 = 20; + STOP_CHARGE_THRESH_BAT0 = 80; + }; + }; }; }