nixos-hardware/common/gpu/amd/default.nix

24 lines
570 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" ];
2024-06-21 09:44:42 -04:00
hardware.graphics = {
enable = lib.mkDefault true;
enable32Bit = lib.mkDefault true;
};
}
(lib.mkIf config.hardware.amdgpu.loadInInitrd {
boot.initrd.kernelModules = [ "amdgpu" ];
})
];
}