Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Rocket league umu #197

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
5 changes: 4 additions & 1 deletion pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
55 changes: 55 additions & 0 deletions pkgs/rocket-league/README.md
Original file line number Diff line number Diff line change
@@ -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.
40 changes: 36 additions & 4 deletions pkgs/rocket-league/bakkesmod.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Expand All @@ -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
''
}

'';

Expand Down
56 changes: 39 additions & 17 deletions pkgs/rocket-league/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 {
Expand All @@ -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;
Expand Down
Loading