Created
March 28, 2019 16:29
-
-
Save andir/6a5add0469b26790bde6dcc47b56403f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; # FIXME: pin the revision | |
let | |
# there is no stable or content adressable URL for this file :( | |
url = https://riotgamespatcher-a.akamaihd.net/releases/live/installer/deploy/League%20of%20Legends%20installer%20NA.exe; | |
registry = pkgs.writeText "registry.reg" '' | |
REGEDIT4 | |
[HKEY_CURRENT_USER\Software\Wine\X11 Driver] | |
GrabFullScreen = "Y" | |
[HKEY_CURRENT_USER\Software\Wine\DirectInput] | |
MouseWrapOverride = "enable" | |
[HKEY_CURRENT_USER\Software\Wine\Direct3D] | |
UseGLSL = "disabled" | |
''; | |
settings = pkgs.writeText "settings.yaml" '' | |
install: | |
globals: | |
locale: "en_US" | |
region: "EUW" | |
''; | |
download = pkgs.writeScriptBin "download" '' | |
${pkgs.curl}/bin/curl -o installer.exe ${url} | |
''; | |
install = pkgs.writeScriptBin "install" '' | |
${init} | |
test -e installer.exe || download | |
wine installer.exe | |
''; | |
launch = pkgs.writeScriptBin "launch" '' | |
${init} | |
wine "''${GAMEPATH}/LeagueClient.exe" | |
''; | |
init = pkgs.writeScriptBin "init" '' | |
winetricks winxp | |
wineserver -k | |
regedit /S ${registry} | |
wineserver -k | |
export SETTINGS_FILE="''${GAMEPATH}Config/LeagueClientSettings.yaml" | |
test -e $SETTINGS_FILE || cp ${settings} "$SETTINGS_FILE" | |
''; | |
in { | |
shell = runCommand "run" { | |
nativeBuildInputs = [ wine-staging winetricks curl download launch init ]; | |
preferLocalBuild = true; | |
shellHook = '' | |
set -ex | |
export WINEPREFIX=$(pwd)/wine | |
export GAMEPATH="$WINEPREFIX/drive_c/Riot Games/League of Legends/" | |
export WINEDLLOVERRIDES="msvcp140=n" | |
mkdir -p $WINEPREFIX | |
echo "run >install< to install the game." | |
echo "run >download< to download the installer." | |
echo "run >launch< to launch the games launcher." | |
''; | |
} ""; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment