From 47ef33f56b4b56cde02b5c52da21a4ec8d2b4533 Mon Sep 17 00:00:00 2001 From: pingu Date: Wed, 16 Jul 2025 22:05:01 +0200 Subject: [PATCH] Drivers --- src/configuration/drivers.md | 55 ++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/configuration/drivers.md b/src/configuration/drivers.md index 0b091b7..fe94b9c 100644 --- a/src/configuration/drivers.md +++ b/src/configuration/drivers.md @@ -1 +1,56 @@ # Drivers + +In general, I would enable the following: +```nix +hardware = { + enableAllFirmware = true; + graphics = { + enable = true; + enable32Bit = true; + }; +}; +``` + +`hardware.graphics.enable` enables hardware accelerated graphics drivers, which should, usually, be enable no matter what. + +## NVIDIA + +This enables the proprietary nvidia drivers, with some reasonable defaults. +```nix +services.xserver.videoDrivers = [ "nvidia" ]; +hardware.nvidia = { + modesetting.enable = true; + open = true; # If you are able to, needs an RTX + nvidiaSettings = true; + package = config.boot.kernelPackages.nvidiaPackages.stable; # https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/linux/nvidia-x11/default.nix for versions available +}; +``` + +## AMD +The following enables the vulkan driver: + +```nix +hardware.amdgpu.amdvlk = { + enable = true; + support32Bit.enable = true; +}; +``` + +## Intel + +I do not have a Intel system to test this on, but the OG manual mention doing either of these depending on if you are getting screen tearing.[^1] + +```nix +services.xserver.videoDrivers = [ "modesetting" ]; # Try this first +``` + +```nix +services.xserver.videoDrivers = [ "intel" ]; # Try these if this the first didn't work +services.xserver.deviceSection = '' + Option "DRI" "2" + Option "TearFree" "true" + ''; + +``` + +[^1]: [NixOS Manual: Intel Graphics drivers](https://nixos.org/manual/nixos/stable/#sec-x11--graphics-cards-intel)