🧹 Moved almost all files to /modules. Moved some code to separate files
This commit is contained in:
19
modules/hardware/graphics/default.nix
Normal file
19
modules/hardware/graphics/default.nix
Normal file
@ -0,0 +1,19 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
# For hardware acceleration
|
||||
environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD";
|
||||
|
||||
# Enable OpenGL
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
extraPackages = with pkgs; [
|
||||
# Used for hardware-acceleration
|
||||
intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD
|
||||
];
|
||||
};
|
||||
}
|
15
modules/hardware/graphics/nvidia.nix
Normal file
15
modules/hardware/graphics/nvidia.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
hardware.nvidia = {
|
||||
# Required
|
||||
modesetting.enable = true;
|
||||
# Use closed-source drivers
|
||||
open = false;
|
||||
# Enable the Nvidia settings menu
|
||||
nvidiaSettings = true;
|
||||
};
|
||||
|
||||
# Load Nvidia driver for Xorg and Wayland
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
}
|
Reference in New Issue
Block a user