From 9b6fba74d00167e81446976eb1151f23bcb94942 Mon Sep 17 00:00:00 2001 From: caem Date: Sun, 21 Jul 2024 22:47:19 +0200 Subject: [PATCH] hyprland: Add nvidia-vaapi-driver --- machines/workstation/hardware-configuration.nix | 1 + packages/wm/hyprland.nix | 3 +++ users/hu/packages/firefox.nix | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/machines/workstation/hardware-configuration.nix b/machines/workstation/hardware-configuration.nix index 7619752..b2d0307 100644 --- a/machines/workstation/hardware-configuration.nix +++ b/machines/workstation/hardware-configuration.nix @@ -42,6 +42,7 @@ boot.extraModprobeConfig = "options kvm_amd nested=1"; boot.kernelParams = [ "nvidia_drm.fbdev=1" + "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ]; boot.initrd.postDeviceCommands = lib.mkAfter '' diff --git a/packages/wm/hyprland.nix b/packages/wm/hyprland.nix index 2ad9a3f..12ab148 100644 --- a/packages/wm/hyprland.nix +++ b/packages/wm/hyprland.nix @@ -12,6 +12,7 @@ wl-clipboard gnome.nautilus pavucontrol + nvidia-vaapi-driver ]; environment.sessionVariables = { @@ -19,6 +20,8 @@ XDG_SESSION_TYPE = "wayland"; GBM_BACKEND = "nvidia-drm"; __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + NVD_BACKEND = "direct"; + MOZ_DISABLE_RDD_SANDBOX = 1; NIXOS_OZONE_WL = 1; }; diff --git a/users/hu/packages/firefox.nix b/users/hu/packages/firefox.nix index 4862394..dfd5b79 100644 --- a/users/hu/packages/firefox.nix +++ b/users/hu/packages/firefox.nix @@ -313,6 +313,11 @@ "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = ""; "browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines" = ""; + # https://github.com/elFarto/nvidia-vaapi-driver?tab=readme-ov-file#firefox + "media.ffmpeg.vaapi.enabled" = true; + "media.rdd-ffmpeg.enabled" = true; + "media.av1.enabled" = false; + # Options for the firefox-ui-fix using Photon # https://github.com/black7375/Firefox-UI-Fix/blob/master/user.js "userChrome.tab.connect_to_window" = true;