Johan Rong před 1 měsícem
rodič
revize
f33a63f61d

+ 1 - 0
hosts/ideapad/nixos/default.nix

@@ -19,6 +19,7 @@ in
     ../../../nixos/modules/hardware/sound
     ../../../nixos/modules/hardware/bluetooth
     ../../../nixos/modules/hardware/biometric/fingerprint/elan.nix
+    ../../../nixos/modules/hardware/battery
 
     #../../../nixos/modules/desktop/mango
     #../../../nixos/modules/greeter/tuigreet/mango.nix

+ 5 - 0
hosts/ono/nixos/default.nix

@@ -19,6 +19,7 @@ in
     ../../../nixos/modules/hardware/sound
     ../../../nixos/modules/hardware/bluetooth
     ../../../nixos/modules/hardware/biometric/fingerprint
+    ../../../nixos/modules/hardware/battery
 
     ../../../nixos/modules/desktop/hyprland
     ../../../nixos/modules/greeter/tuigreet/hyprland.nix
@@ -28,5 +29,9 @@ in
   #  "resume=UUID=3f914128-2e08-4080-b1bb-d7ddf9ef647a"
   #];
 
+  boot.kernelParams = [
+    "amd_pstate=active"
+  ];
+
   networking.hostName = hosts.ono.hostname;
 }

+ 19 - 0
nixos/modules/hardware/battery/default.nix

@@ -0,0 +1,19 @@
+{ config, pkgs, ... }:
+
+{
+  services.power-profiles-daemon.enable = false;
+  services.tlp = {
+    enable = true;
+    settings = {
+      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_AC = "performance";
+      PLATFORM_PROFILE_ON_BAT = "low-power";
+
+      START_CHARGE_THRESH_BAT0 = 40;
+      STOP_CHARGE_THRESH_BAT0 = 80;
+    };
+  };
+}

+ 4 - 0
nixos/modules/hardware/biometric/fingerprint/elan.nix

@@ -1,6 +1,10 @@
 { config, pkgs, ... }:
 
 {
+  imports = [
+    ./default.nix
+  ];
+
   services.fprintd = {
     tod.enable = true;
     tod.driver = pkgs.libfprint-2-tod1-elan;

+ 1 - 2
nixos/profiles/workstation/default.nix

@@ -33,7 +33,6 @@
     cups-pk-helper
     dgop
     cava
-    powertop
     spotify
     #feishin
     obsidian
@@ -151,7 +150,7 @@
   programs.noisetorch.enable = true;
 
   services.upower.enable = true;
-  services.power-profiles-daemon.enable = true;
+  powerManagement.powertop.enable = true;
 
   services.accounts-daemon.enable = true;