Skyler Grey | 81dd90e | 2023-03-26 10:45:11 +0000 | [diff] [blame] | 1 | { 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 Grey | 2bd017d | 2023-02-18 18:15:04 +0000 | [diff] [blame] | 10 | config = { |
| 11 | boot.initrd.kernelModules = [ "radeon" "amdgpu" ]; |
Skyler Grey | 81dd90e | 2023-03-26 10:45:11 +0000 | [diff] [blame] | 12 | services.xserver.videoDrivers = [ "amdgpu" "radeon" "modesetting" "fbdev" ]; |
Skyler Grey | 2bd017d | 2023-02-18 18:15:04 +0000 | [diff] [blame] | 13 | 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 Grey | 81dd90e | 2023-03-26 10:45:11 +0000 | [diff] [blame] | 19 | 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 Grey | 2bd017d | 2023-02-18 18:15:04 +0000 | [diff] [blame] | 29 | }; |
| 30 | } |