blob: 7dbbb6e64bb3952c9f238098b9ee2b52637dde68 [file] [log] [blame]
{ pkgs, lib, ... }: {
home = {
home.file.".config/prelaunch/amd-output-source.sh".text = ''
if [[ $(xrandr --listproviders | grep "AMD Radeon RX 6700 XT @ pci:0000:06:00.0") ]]; then
xrandr --setprovideroutputsource "AMD Radeon RX 6700 XT @ pci:0000:06:00.0" modesetting
fi
'';
home.file.".config/prelaunch/amd-output-source.sh".executable = true;
};
config = {
boot.initrd.kernelModules = [ "radeon" "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" "radeon" "modesetting" "fbdev" ];
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
services.hardware.bolt.enable = true;
services.xserver.config = lib.mkAfter ''
Section "Device"
Identifier "Device-amdgpu[1]"
Driver "amdgpu"
BusID "PCI:06:00.0"
Option "AllowExternalGpus" "True"
Option "AllowEmptyInitialConfiguration"
Option "TearFree" "true"
EndSection
'';
};
}