Browse Source

Add vulkanDriver build option.

main
Philipp 4 months ago
parent
commit
df4ccb0394
No known key found for this signature in database GPG Key ID: 2258EE3B85DE1748
  1. 1
      README.md
  2. 12
      default.nix

1
README.md

@ -37,6 +37,7 @@ into the `Program Files` folder of the prefixs.
* `prefixBaseDir`: Where all the prefixes are installed under.
* `binName`: Name of the generated executable.
* `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.
* `wineSrc`: Points to the source to build wine from.
* `wineGlobalEnv`: Global variables that are exported at script startup.

12
default.nix

@ -4,6 +4,7 @@
prefixBaseDir ? "$HOME/.winenix",
binName ? "starcitizen",
launcherArgs ? [ "--use-gl=osmesa" ],
vulkanDrivers ? [ ],
dxvkPatches ? [ ],
dxvkAsync ? false,
winePackage ? pkgs.wineWowPackages.unstable,
@ -34,7 +35,12 @@ let
( attrs: { patches = attrs.patches ++ dxvkPatches; });
dxvkAsyncEnv = "DXVK_ASYNC=1" ;
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 {};
wine64 = "${winePkg}/bin/wine64";
wineMulti = "${winePkg}/bin/wine";
@ -166,6 +172,10 @@ let
export WINEPREFIX="${prefixBaseDir}/$uuid"
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
${lib.concatMapStrings (x: "export " + x + "\n") (wineGlobalEnv
++ lib.lists.optional dxvkAsync dxvkAsyncEnv

Loading…
Cancel
Save