2023-12-28 16:41:41 +00:00
|
|
|
{ lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
../../../common/cpu/amd
|
|
|
|
../../../common/cpu/amd/pstate.nix
|
|
|
|
../../../common/gpu/amd
|
|
|
|
../../../common/gpu/nvidia
|
|
|
|
../../../common/pc/laptop
|
|
|
|
../../../common/pc/laptop/ssd
|
|
|
|
];
|
|
|
|
|
|
|
|
# Use latest LTS kernel for more Raphael fixes
|
|
|
|
boot = lib.mkMerge [
|
|
|
|
(lib.mkIf (lib.versionOlder pkgs.linux.version "6.6") {
|
2024-01-02 15:19:49 +00:00
|
|
|
kernelPackages = pkgs.linuxPackages_latest;
|
2023-12-28 16:41:41 +00:00
|
|
|
kernelParams = ["amdgpu.sg_display=0"];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
hardware.nvidia = {
|
2024-01-02 05:03:33 +00:00
|
|
|
modesetting.enable = lib.mkDefault true;
|
2023-12-28 16:41:41 +00:00
|
|
|
powerManagement.enable = lib.mkDefault false;
|
|
|
|
powerManagement.finegrained = lib.mkDefault false;
|
|
|
|
open = lib.mkDefault false;
|
|
|
|
prime = {
|
|
|
|
sync.enable = lib.mkDefault true;
|
|
|
|
amdgpuBusId = "PCI:5:0:0";
|
|
|
|
nvidiaBusId = "PCI:1:0:0";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-01-02 05:06:07 +00:00
|
|
|
# Avoid issues with modesetting causing blank screen
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
|
2023-12-28 16:41:41 +00:00
|
|
|
# AMD has better battery life with PPD over TLP:
|
|
|
|
# https://community.frame.work/t/responded-amd-7040-sleep-states/38101/13
|
|
|
|
services.power-profiles-daemon.enable = lib.mkDefault true;
|
|
|
|
}
|