blob: 7dbbb6e64bb3952c9f238098b9ee2b52637dde68 [file] [log] [blame]
Skyler Grey81dd90e2023-03-26 10:45:11 +00001{ pkgs, lib, ... }: {
2 home = {
3 home.file.".config/prelaunch/amd-output-source.sh".text = ''
4 if [[ $(xrandr --listproviders | grep "AMD Radeon RX 6700 XT @ pci:0000:06:00.0") ]]; then
5 xrandr --setprovideroutputsource "AMD Radeon RX 6700 XT @ pci:0000:06:00.0" modesetting
6 fi
7 '';
8 home.file.".config/prelaunch/amd-output-source.sh".executable = true;
9 };
Skyler Grey2bd017d2023-02-18 18:15:04 +000010 config = {
11 boot.initrd.kernelModules = [ "radeon" "amdgpu" ];
Skyler Grey81dd90e2023-03-26 10:45:11 +000012 services.xserver.videoDrivers = [ "amdgpu" "radeon" "modesetting" "fbdev" ];
Skyler Grey2bd017d2023-02-18 18:15:04 +000013 systemd.tmpfiles.rules = [
14 "L+ /opt/rocm/hip - - - - ${pkgs.hip}"
15 ];
16 hardware.opengl.driSupport = true;
17 hardware.opengl.driSupport32Bit = true;
18 services.hardware.bolt.enable = true;
Skyler Grey81dd90e2023-03-26 10:45:11 +000019 services.xserver.config = lib.mkAfter ''
20 Section "Device"
21 Identifier "Device-amdgpu[1]"
22 Driver "amdgpu"
23 BusID "PCI:06:00.0"
24 Option "AllowExternalGpus" "True"
25 Option "AllowEmptyInitialConfiguration"
26 Option "TearFree" "true"
27 EndSection
28 '';
Skyler Grey2bd017d2023-02-18 18:15:04 +000029 };
30}