mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
43 lines
847 B
Nix
43 lines
847 B
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.hardware.amdgpu.preset.default;
|
|
in
|
|
{
|
|
options.hardware.amdgpu.preset.default = {
|
|
enable = mkEnableOption "Enable ADM GPU driver support with some sane defaults";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
hardware.opengl = {
|
|
enable = true;
|
|
driSupport = true;
|
|
driSupport32Bit = true;
|
|
extraPackages = with pkgs; [ rocmPackages.clr.icd ];
|
|
};
|
|
|
|
boot = {
|
|
# https://docs.kernel.org/gpu/amdgpu/module-parameters.html
|
|
kernelParams = [
|
|
"amdgpu.seamless=1"
|
|
"amdgpu.freesync_video=1"
|
|
"initcall_blacklist=simpledrm_platform_driver_init"
|
|
];
|
|
initrd.kernelModules = [ "amdgpu" ];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
amdgpu_top
|
|
glxinfo
|
|
libva-utils
|
|
vulkan-tools
|
|
];
|
|
};
|
|
}
|