mirror of
https://github.com/zephrynis/nix-flake.git
synced 2026-08-18 05:55:53 +00:00
Initial NixOS flake: Hyprland (end-4 illogical-impulse), NVIDIA, gaming, dev tools
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C5ydBQk68JYw8HXzUDLAyV
This commit is contained in:
30
modules/nvidia.nix
Normal file
30
modules/nvidia.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true; # Steam/Proton
|
||||
};
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true; # nvidia-drm.modeset=1 — mandatory for Wayland
|
||||
open = true; # RTX 3080 (Ampere): NVIDIA-recommended on driver >= 560
|
||||
nvidiaSettings = true;
|
||||
powerManagement.enable = true; # preserves VRAM across suspend — avoids Wayland resume corruption
|
||||
powerManagement.finegrained = false; # desktop GPU
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
boot.kernelParams = [ "nvidia_drm.fbdev=1" ];
|
||||
|
||||
environment.sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
NVD_BACKEND = "direct";
|
||||
ELECTRON_OZONE_PLATFORM_HINT = "auto";
|
||||
# Fallbacks — only if symptoms appear (should be unnecessary with driver 560+ / explicit sync):
|
||||
# WLR_NO_HARDWARE_CURSORS = "1"; # invisible/glitchy cursor
|
||||
# __GLX_VENDOR_LIBRARY_NAME = "nvidia"; # Xwayland picks wrong GL vendor
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user