From 70364884a963d35234711c750fd6abdc6ebfb635 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 2 Apr 2023 11:35:35 +0200 Subject: [PATCH] feat(nix): add support for GameMode Signed-off-by: Sefa Eyeoglu --- nix/default.nix | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/nix/default.nix b/nix/default.nix index f219d5d2f..e0616b6ea 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -23,6 +23,8 @@ cmark, msaClientID ? "", jdks ? [jdk17 jdk8], + gamemodeSupport ? true, + gamemode, # flake self, version, @@ -45,7 +47,8 @@ stdenv.mkDerivation rec { tomlplusplus cmark ] - ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland; + ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland + ++ lib.optional gamemodeSupport gamemode.dev; cmakeFlags = lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"] @@ -61,18 +64,19 @@ stdenv.mkDerivation rec { qtWrapperArgs = let libpath = with xorg; - lib.makeLibraryPath [ - libX11 - libXext - libXcursor - libXrandr - libXxf86vm - libpulseaudio - libGL - glfw - openal - stdenv.cc.cc.lib - ]; + lib.makeLibraryPath ([ + libX11 + libXext + libXcursor + libXrandr + libXxf86vm + libpulseaudio + libGL + glfw + openal + stdenv.cc.cc.lib + ] + ++ lib.optional gamemodeSupport gamemode.lib); in [ "--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath}" "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"