From 3caa3cd08cd85692165293d9266afe714abee95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 24 Jan 2024 10:53:49 +0200 Subject: [PATCH] fwminex: some power settings Thanks to https://kirarin.hootr.club/git/steinuil/flakes/src/branch/master/configuration/starry.nix --- hosts/fwminex/configuration.nix | 22 +++++++++++++++++++++- modules/profiles/desktop/default.nix | 10 +++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/hosts/fwminex/configuration.nix b/hosts/fwminex/configuration.nix index bf55dce..ac807ef 100644 --- a/hosts/fwminex/configuration.nix +++ b/hosts/fwminex/configuration.nix @@ -44,7 +44,11 @@ in { }; }; - powerManagement.cpuFreqGovernor = "powersave"; + powerManagement = { + cpuFreqGovernor = "powersave"; + powertop.enable = true; + }; + hardware.cpu.intel.updateMicrocode = true; nixpkgs.hostPlatform = "x86_64-linux"; @@ -166,4 +170,20 @@ in { domain = "motiejus.jakst"; firewall.rejectPackets = true; }; + + services.tlp = { + enable = true; + settings = { + CPU_BOOST_ON_BAT = 0; + CPU_HWP_DYN_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"; + PLATFORM_PROFILE_ON_BAT = "low-power"; + START_CHARGE_THRESH_BAT1 = 90; + STOP_CHARGE_THRESH_BAT1 = 97; + RUNTIME_PM_ON_BAT = "auto"; + }; + }; } diff --git a/modules/profiles/desktop/default.nix b/modules/profiles/desktop/default.nix index f7c7224..0503fa9 100644 --- a/modules/profiles/desktop/default.nix +++ b/modules/profiles/desktop/default.nix @@ -4,7 +4,10 @@ ... }: { config = { - hardware.bluetooth.enable = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; programs = { firefox.enable = true; @@ -14,6 +17,7 @@ mj.base.users.passwd.motiejus.extraGroups = ["adbusers" "networkmanager" "wireshark"]; services = { + fwupd.enable = true; blueman.enable = true; udev.packages = [pkgs.yubikey-personalization]; acpid.enable = true; @@ -51,6 +55,8 @@ alsa.support32Bit = true; pulse.enable = true; }; + + gnome.gnome-keyring.enable = true; }; programs = { @@ -69,8 +75,6 @@ networking.networkmanager.enable = true; - services.gnome.gnome-keyring.enable = true; - # wip put clight-gui to nixpkgs #services.geoclue2 = { # enable = true;