feat: environment variables for wayland & nvidia

This commit is contained in:
Ryan Yin
2025-08-20 12:35:14 +08:00
parent 2b914efbb1
commit 21090c93e8
11 changed files with 60 additions and 78 deletions

View File

@@ -0,0 +1,26 @@
{
config,
lib,
...
}:
with lib;
let
cfg = config.modules.desktop.nvidia;
in
{
options.modules.desktop.nvidia = {
enable = mkEnableOption "whether nvidia GPU is used";
};
config = mkIf (cfg.enable && cfg.enable) {
home.sessionVariables = {
# for hyprland with nvidia gpu" = " ref https://wiki.hyprland.org/Nvidia/
"LIBVA_DRIVER_NAME" = "nvidia";
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
# VA-API hardware video acceleration
"NVD_BACKEND" = "direct";
"GBM_BACKEND" = "nvidia-drm";
};
};
}