2022-03-08 01:42:46 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
2022-03-22 23:48:11 +00:00
|
|
|
gw2dir = "${config.home.homeDirectory}/.volatile/GW2";
|
2020-07-13 20:51:45 +00:00
|
|
|
wine = pkgs.wineWowPackages.staging;
|
|
|
|
gw2env = ''
|
2021-05-18 14:33:28 +00:00
|
|
|
cd ${gw2dir}
|
|
|
|
export MESA_GLSL_CACHE_DISABLE=0
|
|
|
|
export MESA_GLSL_CACHE_DIR="${gw2dir}/shader_cache"
|
|
|
|
export mesa_glthread=true
|
2020-07-13 20:51:45 +00:00
|
|
|
|
2021-05-18 14:33:28 +00:00
|
|
|
# Wine Settings
|
|
|
|
export DXVK_HUD=fps,frametimes
|
|
|
|
export DXVK_LOG_LEVEL=none
|
|
|
|
#export DXVK_STATE_CACHE=1 default
|
|
|
|
export DXVK_STATE_CACHE_PATH="${gw2dir}/dxvk_state_cache/"
|
|
|
|
export WINEDEBUG=-all
|
|
|
|
export WINEARCH=win64
|
|
|
|
export WINEPREFIX="${gw2dir}/data"
|
|
|
|
export STAGING_SHARED_MEMORY=1
|
|
|
|
export WINEESYNC=1
|
2020-07-13 20:51:45 +00:00
|
|
|
'';
|
2020-10-11 13:02:30 +00:00
|
|
|
dxvk = fetchTarball {
|
2021-05-18 14:33:28 +00:00
|
|
|
url = "https://github.com/doitsujin/dxvk/releases/download/v1.7.2/dxvk-1.7.2.tar.gz";
|
|
|
|
sha256 = "07q9fsrvjq2ndnhd93000jw89bkaw6hdi2yhl4d6j8n4ak71r8pv";
|
|
|
|
};
|
|
|
|
gw2installdxvk = pkgs.writeShellScriptBin "gw2-install-dxvk" ''
|
|
|
|
${gw2env}
|
|
|
|
cd ${dxvk}
|
|
|
|
bash ./setup_dxvk.sh install
|
2020-10-11 13:02:30 +00:00
|
|
|
'';
|
2020-07-13 20:51:45 +00:00
|
|
|
gw2setup = pkgs.writeShellScriptBin "gw2-setup" ''
|
2021-05-18 14:33:28 +00:00
|
|
|
mkdir -p ${gw2dir}
|
|
|
|
${gw2env}
|
|
|
|
echo Launching winecfg to configure desktop window
|
|
|
|
${wine}/bin/winecfg
|
|
|
|
echo Installing dxvk
|
|
|
|
${gw2installdxvk}/bin/gw2-install-dxvk
|
|
|
|
echo Downloading installer
|
|
|
|
wget https://account.arena.net/content/download/gw2/win/64 -O Gw2Setup-64.exe
|
|
|
|
echo Running installer
|
|
|
|
${wine}/bin/wine64 ./Gw2Setup-64.exe
|
2020-07-13 20:51:45 +00:00
|
|
|
'';
|
|
|
|
gw2run = pkgs.writeShellScriptBin "gw2" ''
|
2021-05-18 14:33:28 +00:00
|
|
|
${gw2env}
|
2022-03-22 23:48:11 +00:00
|
|
|
cd "${gw2dir}/data/drive_c/Program Files/Guild Wars 2"
|
2021-05-18 14:33:28 +00:00
|
|
|
${wine}/bin/wine64 ./Gw2-64.exe $@ -autologin
|
|
|
|
'';
|
2022-03-08 01:42:46 +00:00
|
|
|
in {
|
2020-05-05 23:40:57 +00:00
|
|
|
home.packages = builtins.attrValues {
|
2021-05-28 16:21:44 +00:00
|
|
|
inherit (pkgs) steam minecraft;
|
2020-10-11 13:02:30 +00:00
|
|
|
inherit gw2run gw2setup wine gw2installdxvk;
|
2020-05-05 23:40:57 +00:00
|
|
|
};
|
|
|
|
}
|