Add vulkanDriver build option.

This commit is contained in:
Philipp 2021-07-27 20:56:30 +02:00
parent 7a096105fb
commit df4ccb0394
No known key found for this signature in database
GPG key ID: 2258EE3B85DE1748
2 changed files with 12 additions and 1 deletions

View file

@ -37,6 +37,7 @@ into the `Program Files` folder of the prefixs.
* `prefixBaseDir`: Where all the prefixes are installed under. * `prefixBaseDir`: Where all the prefixes are installed under.
* `binName`: Name of the generated executable. * `binName`: Name of the generated executable.
* `launcherArgs`: Arguments the RSI Launcher is called with. * `launcherArgs`: Arguments the RSI Launcher is called with.
* `vulkanDrivers`: Force list of vulkan drivers. Supported Elements: `radeon`, `intel` and `amdvlk`
* `winePackage`: Package of wine to use. * `winePackage`: Package of wine to use.
* `wineSrc`: Points to the source to build wine from. * `wineSrc`: Points to the source to build wine from.
* `wineGlobalEnv`: Global variables that are exported at script startup. * `wineGlobalEnv`: Global variables that are exported at script startup.

View file

@ -4,6 +4,7 @@
prefixBaseDir ? "$HOME/.winenix", prefixBaseDir ? "$HOME/.winenix",
binName ? "starcitizen", binName ? "starcitizen",
launcherArgs ? [ "--use-gl=osmesa" ], launcherArgs ? [ "--use-gl=osmesa" ],
vulkanDrivers ? [ ],
dxvkPatches ? [ ], dxvkPatches ? [ ],
dxvkAsync ? false, dxvkAsync ? false,
winePackage ? pkgs.wineWowPackages.unstable, winePackage ? pkgs.wineWowPackages.unstable,
@ -34,7 +35,12 @@ let
( attrs: { patches = attrs.patches ++ dxvkPatches; }); ( attrs: { patches = attrs.patches ++ dxvkPatches; });
dxvkAsyncEnv = "DXVK_ASYNC=1" ; dxvkAsyncEnv = "DXVK_ASYNC=1" ;
gamescope = "${pkgs.callPackage ./gamescope.nix {}}/bin/gamescope"; gamescope = "${pkgs.callPackage ./gamescope.nix {}}/bin/gamescope";
vulkanDriverPaths = {
radeon = "${pkgs.mesa_drivers.drivers}/share/vulkan/icd.d/radeon_icd.x86_64.json";
intel = "${pkgs.mesa_drivers.drivers}/share/vulkan/icd.d/intel_icd.x86_64.json";
amdvlk = "${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json";
};
vkIcd = lib.strings.concatStringsSep ":" (lib.attrsets.attrVals vulkanDrivers vulkanDriverPaths);
fonts = pkgs.callPackage ./fonts.nix {}; fonts = pkgs.callPackage ./fonts.nix {};
wine64 = "${winePkg}/bin/wine64"; wine64 = "${winePkg}/bin/wine64";
wineMulti = "${winePkg}/bin/wine"; wineMulti = "${winePkg}/bin/wine";
@ -166,6 +172,10 @@ let
export WINEPREFIX="${prefixBaseDir}/$uuid" export WINEPREFIX="${prefixBaseDir}/$uuid"
export WINEARCH=win64 export WINEARCH=win64
#optionally export vulkan drivers:
#The following line might be empty in the resulting script.
${lib.optionalString (vulkanDrivers != []) "export VK_ICD_FILENAMES=${vkIcd}"}
#export all global env vars #export all global env vars
${lib.concatMapStrings (x: "export " + x + "\n") (wineGlobalEnv ${lib.concatMapStrings (x: "export " + x + "\n") (wineGlobalEnv
++ lib.lists.optional dxvkAsync dxvkAsyncEnv ++ lib.lists.optional dxvkAsync dxvkAsyncEnv