From 4b35df0924aad2e5f0394aff3010dbe5b84ceda5 Mon Sep 17 00:00:00 2001 From: Florian Zier <9168602+zierf@users.noreply.github.com> Date: Fri, 30 Aug 2024 06:49:00 +0200 Subject: [PATCH] fix(flake): GPU hardware acceleration * Enable hardware acceleration for Nix devenv Section "nativeBuildInputs" needs the dependency "qt6.full" to provide hardware acceleration in QT. Library "wayland" is needed to create a proper OpenGL context under Wayland as well. Provide a check for open AMD driver and use it for VDPAU video hardware acceleration. Move "wrapQtAppsHook" to it's correct place under "nativeBuildInputs". * Add xorg.libXrandr for hardware accelerated video playback. Using libva and openssl libraries eliminates the need for a dependency on the qt6.full library. --- flake.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 50689b6d..ab653ea5 100644 --- a/flake.nix +++ b/flake.nix @@ -88,10 +88,15 @@ setQtEnv = pkgs.runCommand "set-qt-env" { buildInputs = with qt6Pkgs.qt6; [ - qtbase # Needed by wrapQtAppsHook. - wrapQtAppsHook + qtbase ]; - nativeBuildInputs = with pkgs; [ makeShellWrapper ]; + + nativeBuildInputs = (with pkgs; [ + makeShellWrapper + ]) + ++ (with qt6Pkgs.qt6; [ + wrapQtAppsHook + ]); } '' makeShellWrapper "$(type -p sh)" "$out" "''${qtWrapperArgs[@]}" @@ -122,7 +127,9 @@ libglvnd libkrb5 libpulseaudio + libva libxkbcommon + openssl stdenv.cc.cc.lib wayland xorg.libxcb