code dump v1
This commit is contained in:
42
modules/graphics/default.nix
Normal file
42
modules/graphics/default.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
nixosModules.gpuHardware = {gpuVendor ? null, ...}: {
|
||||
hardware.opengl = {
|
||||
# Always enable OpenGL support
|
||||
enable = true;
|
||||
|
||||
# Dynamically select packages based on GPU vendor
|
||||
extraPackages = with pkgs; (
|
||||
# Base packages that are always included
|
||||
[
|
||||
mesa
|
||||
libvdpau-va-gl
|
||||
libva
|
||||
libva-utils
|
||||
]
|
||||
# Vendor-specific packages
|
||||
++ (
|
||||
if gpuVendor == "intel"
|
||||
then [
|
||||
intel-vaapi-driver
|
||||
intel-media-driver
|
||||
]
|
||||
else if gpuVendor == "amd"
|
||||
then [
|
||||
rocm-opencl-icd
|
||||
]
|
||||
else if gpuVendor == "nvidia"
|
||||
then [
|
||||
# Add Nvidia-specific packages if needed
|
||||
nvidia-vaapi-driver
|
||||
]
|
||||
else []
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user