feat(nix): add support for GameMode

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-04-02 11:35:35 +02:00
parent ea7f03770c
commit 70364884a9
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -23,6 +23,8 @@
cmark, cmark,
msaClientID ? "", msaClientID ? "",
jdks ? [jdk17 jdk8], jdks ? [jdk17 jdk8],
gamemodeSupport ? true,
gamemode,
# flake # flake
self, self,
version, version,
@ -45,7 +47,8 @@ stdenv.mkDerivation rec {
tomlplusplus tomlplusplus
cmark cmark
] ]
++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland; ++ lib.optional (lib.versionAtLeast qtbase.version "6") qtwayland
++ lib.optional gamemodeSupport gamemode.dev;
cmakeFlags = cmakeFlags =
lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"] lib.optionals (msaClientID != "") ["-DLauncher_MSA_CLIENT_ID=${msaClientID}"]
@ -61,18 +64,19 @@ stdenv.mkDerivation rec {
qtWrapperArgs = let qtWrapperArgs = let
libpath = with xorg; libpath = with xorg;
lib.makeLibraryPath [ lib.makeLibraryPath ([
libX11 libX11
libXext libXext
libXcursor libXcursor
libXrandr libXrandr
libXxf86vm libXxf86vm
libpulseaudio libpulseaudio
libGL libGL
glfw glfw
openal openal
stdenv.cc.cc.lib stdenv.cc.cc.lib
]; ]
++ lib.optional gamemodeSupport gamemode.lib);
in [ in [
"--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath}" "--set LD_LIBRARY_PATH /run/opengl-driver/lib:${libpath}"
"--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"