From 461aa2d82fc8196ab979b560ead321d84593bcd2 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Tue, 12 Sep 2023 16:28:36 +1200 Subject: [PATCH 1/2] r2modman: pin to Electron 25 Electron 26 is causing many applications to display only a white screen/ window, making them unusable. Fixes #254624 --- pkgs/top-level/all-packages.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 53d61a6fb5a9..c1d9a9d9289f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -38427,7 +38427,10 @@ with pkgs; r2mod_cli = callPackage ../games/r2mod_cli { }; - r2modman = callPackage ../games/r2modman { }; + r2modman = callPackage ../games/r2modman { + # Electron 26 has regressions making applications unusable. + electron = electron_25; + }; racer = callPackage ../games/racer { }; From 363e9382a54b0cc2eec27638a7534adaaf063951 Mon Sep 17 00:00:00 2001 From: Aidan Gauland Date: Tue, 12 Sep 2023 17:00:52 +1200 Subject: [PATCH 2/2] r2modman: fix launching Steam games Patch r2modman to run "steam" instead of trying to directly run "steam.sh" from the user's home directory. This means it uses the NixOS wrapper script, which runs Steam in the necessary FHS environment. Fixes #240369 --- pkgs/games/r2modman/default.nix | 5 +++++ pkgs/games/r2modman/steam-launch-fix.patch | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/games/r2modman/steam-launch-fix.patch diff --git a/pkgs/games/r2modman/default.nix b/pkgs/games/r2modman/default.nix index c7c8d6a10768..4e5096eb96f8 100644 --- a/pkgs/games/r2modman/default.nix +++ b/pkgs/games/r2modman/default.nix @@ -28,6 +28,11 @@ stdenv.mkDerivation rec { hash = "sha256-CXitb/b2tvTfrkFrFv4KP4WdmMg+1sDtC/s2u5ezDfI="; }; + patches = [ + # Make it possible to launch Steam games from r2modman. + ./steam-launch-fix.patch + ]; + nativeBuildInputs = [ yarn fixup_yarn_lock diff --git a/pkgs/games/r2modman/steam-launch-fix.patch b/pkgs/games/r2modman/steam-launch-fix.patch new file mode 100644 index 000000000000..4a52c8fdb359 --- /dev/null +++ b/pkgs/games/r2modman/steam-launch-fix.patch @@ -0,0 +1,21 @@ +diff --git a/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts b/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts +index ddee0e9..fc9ffca 100644 +--- a/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts ++++ b/src/r2mm/launching/runners/linux/SteamGameRunner_Linux.ts +@@ -61,15 +61,9 @@ export default class SteamGameRunner_Linux extends GameRunnerProvider { + async start(game: Game, args: string): Promise { + + const settings = await ManagerSettings.getSingleton(game); +- const steamDir = await GameDirectoryResolverProvider.instance.getSteamDirectory(); +- if(steamDir instanceof R2Error) { +- return steamDir; +- } +- +- LoggerProvider.instance.Log(LogSeverity.INFO, `Steam directory is: ${steamDir}`); + + try { +- const cmd = `"${steamDir}/steam.sh" -applaunch ${game.activePlatform.storeIdentifier} ${args} ${settings.getContext().gameSpecific.launchParameters}`; ++ const cmd = `steam -applaunch ${game.activePlatform.storeIdentifier} ${args} ${settings.getContext().gameSpecific.launchParameters}`; + LoggerProvider.instance.Log(LogSeverity.INFO, `Running command: ${cmd}`); + await exec(cmd); + } catch(err) {