mirror of
https://github.com/ItsDrike/nixdots
synced 2025-06-30 10:20:43 +00:00
Add gpu settings
This commit is contained in:
parent
53771e1547
commit
163eafb8f0
6 changed files with 136 additions and 0 deletions
39
system/shared/hardware/gpu/amd.nix
Normal file
39
system/shared/hardware/gpu/amd.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
# WARNING: This file is currently untested
|
||||
# (I didn't yet run this NixOS config on any AMD GPU systems)
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
dev = config.myOptions.device;
|
||||
in
|
||||
{
|
||||
config = lib.mkIf (dev.gpu.type == "amd") {
|
||||
services.xserver.videoDrivers = lib.mkDefault ["modesetting" "amdgpu"];
|
||||
|
||||
boot = {
|
||||
initrd.kernelModules = ["amdgpu"]; # load amdgpu kernel module as early as initrd
|
||||
kernelModules = ["amdgpu"]; # if loading somehow fails during initrd but the boot continues, try again later
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
mesa
|
||||
|
||||
vulkan-tools
|
||||
vulkan-loader
|
||||
vulkan-validation-layers
|
||||
vulkan-extension-layer
|
||||
];
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
|
||||
# Enable OpenCL and AMDVLK
|
||||
extraPackages = with pkgs; [
|
||||
amdvlk
|
||||
rcomPackages.clr.icd
|
||||
];
|
||||
extraPackages32 = with pkgs; [
|
||||
driversi686Linux.amdvlk
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue