2025-01-18 18:01:44 +01:00
|
|
|
{
|
|
|
|
description = "Wine minimal configuration to reproduce the problem";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
|
|
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
|
|
|
|
inherit (pkgs.lib.strings) concatStringsSep;
|
|
|
|
inherit (pkgs) writeShellScriptBin fetchurl;
|
|
|
|
|
|
|
|
epic_games_launcher = fetchurl {
|
|
|
|
url = "https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi";
|
|
|
|
name = "EpicGamesLauncherInstaller.msi";
|
2025-01-18 18:02:35 +01:00
|
|
|
# hash = pkgs.lib.fakeHash;
|
2025-01-18 18:01:44 +01:00
|
|
|
hash = "sha256-vbd+h7nWZmNOGC6kJILZVZElyo5iwjmbitLGtCOVqqg=";
|
|
|
|
};
|
|
|
|
|
|
|
|
# concat winetricks args
|
2025-01-18 19:01:16 +01:00
|
|
|
winetricksPackages = [ "corefonts" ];
|
|
|
|
winetricksArgs =
|
|
|
|
if (builtins.length winetricksPackages) > 0
|
|
|
|
then concatStringsSep " " winetricksPackages
|
|
|
|
else "-V";
|
|
|
|
|
|
|
|
# concat dll overrides
|
|
|
|
wineDllOverrides = ["winemenubuilder.exe=d"];
|
|
|
|
wineDllOverridesEnv = pkgs.lib.strings.concatStringsSep "," wineDllOverrides;
|
2025-01-18 18:01:44 +01:00
|
|
|
|
|
|
|
install_script = writeShellScriptBin "install" ''
|
2025-01-18 18:18:02 +01:00
|
|
|
echo "Installing Dependencies"
|
2025-01-18 18:01:44 +01:00
|
|
|
winetricks -q -f ${winetricksArgs}
|
|
|
|
wineserver -k
|
2025-01-18 18:18:02 +01:00
|
|
|
echo "Dependencies Installed"
|
2025-01-18 18:01:44 +01:00
|
|
|
|
2025-01-18 18:18:02 +01:00
|
|
|
echo "Installing Epic Games Launcher"
|
2025-01-18 19:01:16 +01:00
|
|
|
$WINE ${epic_games_launcher} /q
|
2025-01-18 18:01:44 +01:00
|
|
|
wineserver -k
|
2025-01-18 18:18:02 +01:00
|
|
|
echo "Epic Games Launcher Installed"
|
2025-01-18 18:01:44 +01:00
|
|
|
'';
|
|
|
|
|
2025-01-18 19:01:16 +01:00
|
|
|
stop_script = writeShellScriptBin "stop" ''
|
|
|
|
wineserver -k
|
|
|
|
'';
|
|
|
|
|
2025-01-18 18:01:44 +01:00
|
|
|
clean_script = writeShellScriptBin "clean" ''
|
2025-01-18 19:01:16 +01:00
|
|
|
wineserver -k
|
2025-01-18 18:01:44 +01:00
|
|
|
rm -rf $WINEPREFIX
|
|
|
|
'';
|
|
|
|
|
|
|
|
run_script = writeShellScriptBin "run" ''
|
2025-01-18 19:01:16 +01:00
|
|
|
$WINE "$WINEPREFIX/drive_c/Program Files (x86)/Epic Games/Launcher/Portal/Binaries/Win32/EpicGamesLauncher.exe"
|
2025-01-18 20:21:29 +01:00
|
|
|
wineserver -w
|
2025-01-18 18:01:44 +01:00
|
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShells = {
|
|
|
|
default = pkgs.mkShell {
|
|
|
|
packages = with pkgs; [
|
2025-01-18 19:01:16 +01:00
|
|
|
# Wine packages
|
2025-01-18 20:21:29 +01:00
|
|
|
wineWowPackages.unstableFull
|
2025-01-18 18:01:44 +01:00
|
|
|
winetricks
|
2025-01-18 19:01:16 +01:00
|
|
|
|
|
|
|
# Custom scripts
|
2025-01-18 18:01:44 +01:00
|
|
|
install_script
|
|
|
|
run_script
|
2025-01-18 19:01:16 +01:00
|
|
|
stop_script
|
2025-01-18 18:01:44 +01:00
|
|
|
clean_script
|
|
|
|
];
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
export WINETRICKS_LATEST_VERSION_CHECK=disabled
|
|
|
|
export WINEPREFIX=$(pwd)/wine_prefix
|
2025-01-18 19:01:16 +01:00
|
|
|
export WINE=wine
|
2025-01-18 18:01:44 +01:00
|
|
|
export WINEARCH="win64"
|
|
|
|
export WINEDEBUG=-all
|
2025-01-18 19:01:16 +01:00
|
|
|
export WINEDLLOVERRIDES="${wineDllOverridesEnv}"
|
2025-01-18 18:01:44 +01:00
|
|
|
|
|
|
|
if [ ! -d "$WINEPREFIX" ]; then
|
|
|
|
install
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|