diff --git a/README.md b/README.md index bc348f90..521b843f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ See an overview of the flake outputs by running | [`faf-client`](./pkgs/faf-client) | Forged Alliance Forever client (multiple packages) | | [`osu-lazer-bin`](./pkgs/osu-lazer-bin) | osu! lazer, extracted from the official AppImage | | [`osu-stable`](./pkgs/osu-stable) | osu! stable version | -| `rocket-league` | Rocket League from Epic Games | +| [`rocket-league`](./pkgs/rocket-league) | Rocket League from Epic Games | | [`star-citizen`](./pkgs/star-citizen) | Star Citizen | | [`technic-launcher`](./pkgs/technic-launcher) | Technic Launcher | | [`wine-discord-ipc-bridge`](./pkgs/wine-discord-ipc-bridge) | Wine-Discord RPC Bridge | diff --git a/pkgs/default.nix b/pkgs/default.nix index d0b46341..b10fb6b3 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -86,7 +86,10 @@ inherit (config.packages) wine-discord-ipc-bridge; }; - rocket-league = pkgs.callPackage ./rocket-league {wine = config.packages.wine-tkg;}; + rocket-league = pkgs.callPackage ./rocket-league { + wine = config.packages.wine-tkg; + inherit (config.packages) umu; + }; star-citizen = pkgs.callPackage ./star-citizen { wine = pkgs.wineWowPackages.staging; diff --git a/pkgs/rocket-league/README.md b/pkgs/rocket-league/README.md new file mode 100644 index 00000000..7e1b7e6c --- /dev/null +++ b/pkgs/rocket-league/README.md @@ -0,0 +1,55 @@ +# Rocket League + +Installer for Epic Games version of [Rocket League](https://www.rocketleague.com/). [legendary](https://github.com/derrod/legendary) is used for authentication and launching the game. + +## How to use +Make sure you have logged in with legendary, you don't have to have legendary available in your system, if that is the case, you can temporarily enable it and log in; +```bash +$ nix shell nixpkgs#legendary-gl +$ legendary auth +``` + +After logging in you can add rocket-league to your `home.packages` or `environment.systemPackages` by adding `nix-gaming` to your inputs. + +You can run the game through multiple runners, the default runner is `wine-tkg` however you can override it like that; + +```nix + home-manager.users.emrebicer = { + home.packages = with pkgs; [ + (inputs.nix-gaming.packages.${pkgs.system}.rocket-league.override { + wine = "${inputs.nix-gaming.packages.${pkgs.system}.wine-ge}"; + }) + ]; + }; +``` + +After executing `nixos-rebuild switch` you should have `rocket-league` available to your system. + +## Enabling bakkesmod + +You can enable bakkesmod by overriding rocket-league like that; +```nix + home-manager.users.emrebicer = { + home.packages = with pkgs; [ + (inputs.nix-gaming.packages.${pkgs.system}.rocket-league.override { + enableBakkesmod = true; + }) + ]; + }; +``` + +After rebuilding, `bakkesmod` will be available to your system, just run bakkesmod once to install it, don't create a desktop item and finish the installation. Then you should be able to run bakkesmod and Rocket League at the same time. If bakkesmod does not inject automatically make sure to disable `Safe mode` through bakkesmod settings. + +## Running with umu instead of wine +If you want to use [umu-launcher](https://github.com/Open-Wine-Components/umu-launcher) to run Rocket League, you can do so by overriding `useUmu` like that; +```nix + home-manager.users.emrebicer = { + home.packages = with pkgs; [ + (inputs.nix-gaming.packages.${pkgs.system}.rocket-league.override { + useUmu = true; + }) + ]; + }; +``` + +If `useUmu` is set to true, wine option will be ignored. diff --git a/pkgs/rocket-league/bakkesmod.nix b/pkgs/rocket-league/bakkesmod.nix index ce8d80d6..684e6c2f 100644 --- a/pkgs/rocket-league/bakkesmod.nix +++ b/pkgs/rocket-league/bakkesmod.nix @@ -6,8 +6,9 @@ fetchurl, unzip, wine, - pname ? "rocket-league", - location ? "$HOME/Games/${pname}", + location, + umu, + useUmu, }: let bakkesmodIcon = fetchurl { url = "https://bp-prod.nyc3.digitaloceanspaces.com/site-assets/static/bm-transparent.png"; @@ -27,7 +28,22 @@ ${unzip}/bin/unzip $TEMP_DIR/BakkesModSetup.zip -d $TEMP_DIR # Run the bakkesmod installer - WINEPREFIX="${location}" WINEFSYNC=1 ${wine}/bin/wine $TEMP_DIR/BakkesModSetup.exe + ${ + if useUmu + then '' + export WINEPREFIX="${location}" + export GAMEID=umu-252950 + export STORE=egs + export PROTON_VERB=runinprefix + + PATH=${umu}/bin:$PATH + + umu-run $TEMP_DIR/BakkesModSetup.exe + '' + else '' + WINEPREFIX="${location}" WINEFSYNC=1 ${wine}/bin/wine $TEMP_DIR/BakkesModSetup.exe + '' + } # Clean up rm $TEMP_DIR/BakkesModSetup.zip @@ -45,7 +61,23 @@ fi echo "Starting bakkesmod..." - WINEPREFIX="${location}" WINEFSYNC=1 ${wine}/bin/wine c:/Program\ Files/BakkesMod/BakkesMod.exe + + ${ + if useUmu + then '' + export WINEPREFIX="${location}" + export GAMEID=umu-252950 + export STORE=egs + export PROTON_VERB=runinprefix + + PATH=${umu}/bin:$PATH + + umu-run c:/Program\ Files/BakkesMod/BakkesMod.exe + '' + else '' + WINEPREFIX="${location}" WINEFSYNC=1 ${wine}/bin/wine c:/Program\ Files/BakkesMod/BakkesMod.exe + '' + } ''; diff --git a/pkgs/rocket-league/default.nix b/pkgs/rocket-league/default.nix index a70696b2..48ed1e2b 100644 --- a/pkgs/rocket-league/default.nix +++ b/pkgs/rocket-league/default.nix @@ -8,11 +8,17 @@ winetricks, wine, pname ? "rocket-league", - location ? "$HOME/Games/${pname}", + location ? ( + if useUmu + then "$HOME/Games/umu/umu-252950" + else "$HOME/Games/${pname}" + ), tricks ? ["arial" "cjkfonts" "vcrun2019" "d3dcompiler_43" "d3dcompiler_47" "d3dx9"], dxvk_hud ? "compiler", callPackage, enableBakkesmod ? false, + umu, + useUmu ? false, }: let icon = builtins.fetchurl { # original url = "https://www.pngkey.com/png/full/16-160666_rocket-league-png.png"; @@ -28,25 +34,41 @@ else "-V"; script = writeShellScriptBin pname '' - export WINEPREFIX="${location}" + export DXVK_HUD=${dxvk_hud} - export MESA_GL_VERSION_OVERRIDE=4.4COMPAT - export WINEFSYNC=1 - export WINEESYNC=1 - export __GL_SHADER_DISK_CACHE=1 - export __GL_SHADER_DISK_CACHE_PATH="${location}" + export WINEPREFIX="${location}" + + ${ + if useUmu + then '' + export GAMEID=umu-252950 + export STORE=egs + + PATH=${umu}/bin:${legendary-gl}/bin:${gamemode}/bin:$PATH + + legendary update Sugar --base-path ${location} + legendary launch Sugar --no-wine --wrapper "gamemoderun umu-run" --base-path ${location} + '' + else '' + export MESA_GL_VERSION_OVERRIDE=4.4COMPAT + export WINEFSYNC=1 + export WINEESYNC=1 + export __GL_SHADER_DISK_CACHE=1 + export __GL_SHADER_DISK_CACHE_PATH="${location}" - PATH=${wine}/bin:${winetricks}/bin:${legendary-gl}/bin:${gamemode}:$PATH + PATH=${wine}/bin:${winetricks}/bin:${legendary-gl}/bin:${gamemode}/bin:$PATH - if [ ! -d "$WINEPREFIX" ]; then - # install tricks - winetricks -q ${tricksString} - wineserver -k - fi + if [ ! -d "$WINEPREFIX" ]; then + # install tricks + winetricks -q ${tricksString} + wineserver -k + fi - legendary update Sugar --base-path ${location} - gamemoderun legendary launch Sugar --base-path ${location} - wineserver -w + legendary update Sugar --base-path ${location} + gamemoderun legendary launch Sugar --base-path ${location} + wineserver -w + '' + } ''; desktopItems = makeDesktopItem { @@ -57,7 +79,7 @@ categories = ["Game"]; }; - bakkesmod = callPackage ./bakkesmod.nix {inherit location wine;}; + bakkesmod = callPackage ./bakkesmod.nix {inherit location wine umu useUmu;}; in symlinkJoin { name = pname;