1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-09-20 05:17:22 +02:00
nixos-hardware/common/gpu/amd/default.nix

24 lines
576 B
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
{
options.hardware.amdgpu.loadInInitrd = lib.mkEnableOption (lib.mdDoc
"loading `amdgpu` kernelModule at stage 1. (Add `amdgpu` to `boot.initrd.kernelModules`)"
) // {
default = true;
};
config = lib.mkMerge [
{
services.xserver.videoDrivers = lib.mkDefault [ "modesetting" ];
hardware.opengl = {
driSupport = lib.mkDefault true;
driSupport32Bit = lib.mkDefault true;
};
}
(lib.mkIf config.hardware.amdgpu.loadInInitrd {
boot.initrd.kernelModules = [ "amdgpu" ];
})
];
}