From 5bc8a32fc938a923137e44236e96616ef6d36ae7 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 18 Jan 2025 18:01:44 +0100 Subject: [PATCH] Begin work --- .gitignore | 2 +- README.md | 9 ++++--- flake.lock | 61 +++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 4 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index a806510..fe87916 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ # Ignore build outputs from performing a nix-build or `nix build` command result result-* - +wine_prefix diff --git a/README.md b/README.md index 1f9f055..c07a88a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ -# unreal_engine_bug_flake - +# unreal_engine_bug_flake + Project used to declare wine configuration to help developer to find the problem -bugs.winehq.org/show_bug.cgi?id=56654 \ No newline at end of file +bugs.winehq.org/show_bug.cgi?id=56654 + +Usefull links + - https://github.com/fufexan/nix-gaming/blob/master/pkgs/star-citizen/default.nix \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a086c34 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1737003892, + "narHash": "sha256-RCzJE9wKByLCXmRBp+z8LK9EgdW+K+W/DXnJS4S/NVo=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ae06b9c2d83cb5c8b12d7d0e32692e93d1379713", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3366f47 --- /dev/null +++ b/flake.nix @@ -0,0 +1,69 @@ +{ + 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"; + # hash = plks.lib.fakeHash; + hash = "sha256-vbd+h7nWZmNOGC6kJILZVZElyo5iwjmbitLGtCOVqqg="; + }; + + # concat winetricks args + winetricksArgs = concatStringsSep " " [ "corefonts" ]; + + install_script = writeShellScriptBin "install" '' + # install tricks + winetricks -q -f ${winetricksArgs} + wineserver -k + + # Install Epic Games Launcher + wine ${epic_games_launcher} /S + wineserver -k + ''; + + clean_script = writeShellScriptBin "clean" '' + rm -rf $WINEPREFIX + ''; + + run_script = writeShellScriptBin "run" '' + + ''; + in + { + devShells = { + default = pkgs.mkShell { + packages = with pkgs; [ + winePackages.unstableFull + winetricks + install_script + run_script + clean_script + ]; + + shellHook = '' + export WINETRICKS_LATEST_VERSION_CHECK=disabled + export WINEPREFIX=$(pwd)/wine_prefix + export WINEARCH="win64" + export WINEDEBUG=-all + + if [ ! -d "$WINEPREFIX" ]; then + install + fi + ''; + }; + }; + }); +}