1
0
Fork 0
nixos-config/home-manager/roles/games.nix

69 lines
2.1 KiB
Nix
Raw Normal View History

2020-07-13 20:51:45 +00:00
{ pkgs, lib, config, ... }: let
gw2dir = "${config.home.homeDirectory}/volatile/GW2";
wine = pkgs.wineWowPackages.staging;
gw2env = ''
2020-10-11 13:02:30 +00:00
cd ${gw2dir}
2020-07-13 20:51:45 +00:00
export MESA_GLSL_CACHE_DISABLE=0
2020-10-11 13:02:30 +00:00
export MESA_GLSL_CACHE_DIR="${gw2dir}/shader_cache"
2020-07-13 20:51:45 +00:00
export mesa_glthread=true
# Wine Settings
2020-10-11 13:02:30 +00:00
export DXVK_HUD=fps,frametimes
2020-07-13 20:51:45 +00:00
export DXVK_LOG_LEVEL=none
2020-10-11 13:02:30 +00:00
#export DXVK_STATE_CACHE=1 default
export DXVK_STATE_CACHE_PATH="${gw2dir}/dxvk_state_cache/"
2020-07-13 20:51:45 +00:00
export WINEDEBUG=-all
export WINEARCH=win64
2020-10-11 13:02:30 +00:00
export WINEPREFIX="${gw2dir}/data"
2020-07-13 20:51:45 +00:00
export STAGING_SHARED_MEMORY=1
export WINEESYNC=1
'';
2020-10-11 13:02:30 +00:00
dxvk = fetchTarball {
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-07-13 20:51:45 +00:00
gw2setup = pkgs.writeShellScriptBin "gw2-setup" ''
mkdir -p ${gw2dir}
${gw2env}
echo Launching winecfg to configure desktop window
${wine}/bin/winecfg
2020-10-11 13:02:30 +00:00
echo Installing dxvk
${gw2installdxvk}/bin/gw2-install-dxvk
2020-07-13 20:51:45 +00:00
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
'';
gw2run = pkgs.writeShellScriptBin "gw2" ''
${gw2env}
2020-10-11 13:02:30 +00:00
cd "${gw2dir}/data/drive_c/Guild Wars 2"
2020-07-13 20:51:45 +00:00
${wine}/bin/wine64 ./Gw2-64.exe $@ -autologin
'';
in
{
dconf.settings."org/gnome/settings-daemon/plugins/media-keys" = {
mic-mute = lib.mkForce [ ];
next = lib.mkForce [ ];
play = lib.mkForce [ ];
previous = lib.mkForce [ ];
screensaver = lib.mkForce [ ];
volume-down = lib.mkForce [ ];
volume-up = lib.mkForce [ ];
};
2020-06-02 01:50:36 +00:00
2020-05-05 23:40:57 +00:00
home.packages = builtins.attrValues {
2020-09-16 17:55:08 +00:00
factorio = pkgs.factorio.override {
2020-07-07 15:40:36 +00:00
username = "maralorn";
2020-09-30 23:30:40 +00:00
token = pkgs.privateValue "" "factorio";
2020-07-07 15:40:36 +00:00
};
2020-09-16 17:55:08 +00:00
inherit (pkgs) steam minetest;
2020-10-11 13:02:30 +00:00
inherit gw2run gw2setup wine gw2installdxvk;
2020-05-05 23:40:57 +00:00
};
}