Refactor laptop conf
This commit is contained in:
parent
d60f2d26a7
commit
13f46e06de
4 changed files with 37 additions and 14 deletions
|
@ -1,5 +1,7 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
imports = [ ./laptop.nix ];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [ zenmonitor ];
|
environment.systemPackages = with pkgs; [ zenmonitor ];
|
||||||
|
|
||||||
hardware.opengl.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
|
hardware.opengl.extraPackages = with pkgs; [ rocmPackages.clr.icd ];
|
||||||
|
@ -7,15 +9,6 @@
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
xserver = pkgs.lib.mkIf config.services.xserver.enable {
|
xserver = pkgs.lib.mkIf config.services.xserver.enable { videoDrivers = [ "amdgpu" ]; };
|
||||||
videoDrivers = [
|
|
||||||
"amdgpu"
|
|
||||||
"modesetting"
|
|
||||||
];
|
|
||||||
deviceSection = ''
|
|
||||||
Option "DRI" "2"
|
|
||||||
Option "TearFree" "true"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
33
hardware-specific/laptop.nix
Normal file
33
hardware-specific/laptop.nix
Normal 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
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -79,8 +79,6 @@
|
||||||
../hardware-specific/usb-automount.nix
|
../hardware-specific/usb-automount.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.tlp.enable = true;
|
|
||||||
|
|
||||||
services.xserver.displayManager.setupCommands = ''
|
services.xserver.displayManager.setupCommands = ''
|
||||||
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 --auto --pos 0x0 --primary --output eDP --auto --pos 3840x360
|
${pkgs.xorg.xrandr}/bin/xrandr --output DisplayPort-0 --auto --pos 0x0 --primary --output eDP --auto --pos 3840x360
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -57,10 +57,9 @@
|
||||||
../hardware-specific/keychron-q11.nix
|
../hardware-specific/keychron-q11.nix
|
||||||
../hardware-specific/trackball.nix
|
../hardware-specific/trackball.nix
|
||||||
../hardware-specific/usb-automount.nix
|
../hardware-specific/usb-automount.nix
|
||||||
|
../hardware-specific/laptop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
services.tlp.enable = true;
|
|
||||||
|
|
||||||
system.autoUpgrade.allowReboot = pkgs.lib.mkForce false;
|
system.autoUpgrade.allowReboot = pkgs.lib.mkForce false;
|
||||||
|
|
||||||
swapDevices = pkgs.lib.mkForce [
|
swapDevices = pkgs.lib.mkForce [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue