Refactor laptop conf

This commit is contained in:
Vili Sinervä 2024-11-21 14:25:33 +02:00
parent d60f2d26a7
commit 13f46e06de
No known key found for this signature in database
GPG key ID: DF8FEAF54EFAC996
4 changed files with 37 additions and 14 deletions

View file

@ -1,5 +1,7 @@
{ config, pkgs, ... }:
{
imports = [ ./laptop.nix ];
environment.systemPackages = with pkgs; [ zenmonitor ];
hardware.opengl.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
@ -7,15 +9,6 @@
boot.initrd.kernelModules = [ "amdgpu" ];
services = {
xserver = pkgs.lib.mkIf config.services.xserver.enable {
videoDrivers = [
"amdgpu"
"modesetting"
];
deviceSection = ''
Option "DRI" "2"
Option "TearFree" "true"
'';
};
xserver = pkgs.lib.mkIf config.services.xserver.enable { videoDrivers = [ "amdgpu" ]; };
};
}

View file

@ -0,0 +1,33 @@
{ config, pkgs, ... }:
{
services = {
xserver = pkgs.lib.mkIf config.services.xserver.enable {
videoDrivers = [ "modesetting" ];
deviceSection = ''
Option "DRI" "2"
Option "TearFree" "true"
'';
};
};
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 40;
#Optional helps save long term battery health
START_CHARGE_THRESH_BAT0 = 60; # 60 and bellow it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
};
};
}

View file

@ -79,8 +79,6 @@
../hardware-specific/usb-automount.nix
];
services.tlp.enable = true;
services.xserver.displayManager.setupCommands = ''
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 --auto --pos 0x0 --primary --output eDP --auto --pos 3840x360
'';

View file

@ -57,10 +57,9 @@
../hardware-specific/keychron-q11.nix
../hardware-specific/trackball.nix
../hardware-specific/usb-automount.nix
../hardware-specific/laptop.nix
];
services.tlp.enable = true;
system.autoUpgrade.allowReboot = pkgs.lib.mkForce false;
swapDevices = pkgs.lib.mkForce [