mirror of
https://github.com/NixOS/nixos-hardware
synced 2024-11-26 21:09:42 +01:00
Add a option to add(or disadd) amdgpu to kernelModule
Add a option to add(or disadd) amdgpu to boot.initrd.kernelModule
This commit is contained in:
parent
1f60672721
commit
a1a8723bf9
1 changed files with 29 additions and 17 deletions
|
@ -1,8 +1,15 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
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 [ "amdgpu" ];
|
||||
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
rocm-opencl-icd
|
||||
|
@ -20,4 +27,9 @@
|
|||
};
|
||||
|
||||
environment.variables.AMD_VULKAN_ICD = lib.mkDefault "RADV";
|
||||
}
|
||||
(lib.mkIf config.hardware.amdgpu.loadInInitrd {
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue