I’ve got a currently working setup with hardware.nvidia.prime.offload.enable
on my laptop using the amdgpu
driver (which is the default for AMD cards when specifying prime.amdgpuBusId
) but would like to switch to modesetting
since there seems to be a push for it as the default driver for all cards in nixpkgs
and nixos-hardware
(and the fact that amdgpu
is kinda dead development wise + it gives me a 10x decrease in frametimes in mpv and has no apparent drawbacks).
If I try to currently include the modesetting
driver in services.xserver.videoDrivers
, Xorg fails to start due to the leftover amdgpu
device and screen entries created by prime.amdgpuBusId
(which also happens if modesetting
is specified both via videoDrivers
and the patched amdgpuBusId
option, since multiple device/screen entries are created).
Manually hardcoding those out with a custom config or using a patched nixpkgs to always choose modesetting
in nixpkgs/nvidia.nix at 99fe1b870522d6ee3e692c2b6e663d6868a3fde4 · NixOS/nixpkgs · GitHub fixes the issue, but I’m not sure of how to proceed.
Using a normal config file (instead of hoping that the config generating process plays well with the driver) is probably the best option, but I’m not sure of wether things would break if I leave out or hardcode the Section "Files"
part since the paths inside could change as I update, as just “adding after” the existing config doesn’t seem to do the trick to replace the driver used.