diff --git a/default.nix b/default.nix index 5e82a8f8..35f513d7 100644 --- a/default.nix +++ b/default.nix @@ -57,7 +57,7 @@ himalaya.overrideAttrs (drv: { # NOTE: manual wineprefix update is somehow needed: # postInstall = (drv.postInstall or "") + lib.optionalString hostPlatform.isWindows '' - ${lib.getExe' wine "wineboot"} --init + export WINEPREFIX="$(${lib.getExe mktemp} -d)" '' + '' mkdir -p $out/bin/share/{applications,completions,man,services} cp assets/himalaya.desktop $out/bin/share/applications/ diff --git a/flake.nix b/flake.nix index 01262db9..a0680284 100644 --- a/flake.nix +++ b/flake.nix @@ -84,12 +84,16 @@ mkCrossApp = system: crossConfig: let pkgs = import nixpkgs { inherit system; }; + mktemp = "${lib.getExe pkgs.mktemp} -d"; emulator = crossPkgs.hostPlatform.emulator pkgs; crossSystem = { config = crossConfig; isStatic = true; }; crossPkgs = import nixpkgs { inherit system crossSystem; }; crossPkgName = "cross-${crossPkgs.hostPlatform.system}"; crossPkgExe = lib.getExe self.packages.${system}.${crossPkgName}; - program = lib.getExe (pkgs.writeShellScriptBin "himalaya" "${emulator} ${crossPkgExe} $@"); + program = lib.getExe (pkgs.writeShellScriptBin "himalaya" '' + ${lib.optionalString crossPkgs.hostPlatform.isWindows "export WINEPREFIX=$(${mktemp})"} + ${emulator} ${crossPkgExe} $@ + ''); in { "${crossPkgName}" = { inherit program; type = "app"; }; }; in