From 3cda79c0b4174ef7b7aec80c5f4eb1fc080d4dfb Mon Sep 17 00:00:00 2001 From: Leander Scherer Date: Sun, 14 Jun 2026 23:55:47 +0200 Subject: fix(wine): fix issues with win64 and win32 --- modules/system/wine.nix | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) (limited to 'modules/system/wine.nix') diff --git a/modules/system/wine.nix b/modules/system/wine.nix index e78dbed..ac5074b 100644 --- a/modules/system/wine.nix +++ b/modules/system/wine.nix @@ -1,17 +1,43 @@ { flake.modules.homeManager.wine = - { pkgs, ... }: + { pkgs, config, ... }: + let + wine = pkgs.wineWow64Packages.waylandFull; + + wineForWinetricks = pkgs.runCommand "wine-for-winetricks" {} '' + mkdir -p $out/bin + + ln -s ${wine}/bin/wine $out/bin/wine + ln -s ${wine}/bin/wine $out/bin/wine64 + ln -s ${wine}/bin/wineserver $out/bin/wineserver + ''; + + winetricksFixed = pkgs.writeShellScriptBin "winetricks" '' + export WINE="${wineForWinetricks}/bin/wine" + export WINELOADER="${wineForWinetricks}/bin/wine" + export WINESERVER="${wineForWinetricks}/bin/wineserver" + + # NixOS WoW64 wrapper fix. + export WINE_BIN="${wine}/bin/.wine" + export WINESERVER_BIN="${wine}/bin/wineserver" + + export WINEPREFIX="${config.home.homeDirectory}/.wine" + export PATH="${wineForWinetricks}/bin:$PATH" + + exec ${pkgs.winetricks}/bin/winetricks "$@" + ''; + + q4wineFixed = pkgs.q4wine.override { + inherit wine; + }; + in { - home.packages = with pkgs; [ - q4wine - winetricks - unzip - cabextract - wineWow64Packages.waylandFull + home.packages = [ + wine + q4wineFixed + winetricksFixed + pkgs.unzip + pkgs.cabextract ]; - home.sessionVariables = { - WINEARCH = "win64"; - WINEPREFIX = "$HOME/.wine"; - }; }; } -- cgit v1.3.1