Change:
Project description introduced amdvlk to nixos already, but afaict this only works with 64bit application, but since a lot of especially games are still 32bit it really would be nice to also be able to run those with amdvlk. I currently have this: In my nixos configuration to make sure that if possible amdvlk is used but also to make sure 32bit applications can still run Metadata should be the same
What would be the right way to do this with nix? The possibilities I see are: with the nix i686 toolchain (working amdvlk here: , can be used as ) A disadvantage of 2. is that it does not support lto.

Discussion:
be forced as follows: <programlisting><xref linkend="opt-hardware.opengl.extraPackages"/> = [ <del> <package>amdvlk</package> </del> <ins> pkgs.<package>amdvlk</package> ]; # To enable Vulkan support for 32-bit applications, also add: <xref linkend="opt-hardware.opengl.extraPackages32"/> = [ pkgs.driversi686Linux.<package>amdvlk</package> </ins> ]; # For amdvlk

, xorg , zlib }: <ins> let </ins> <del> stdenv.mkDerivation rec { </del> <ins> suffix = if stdenv.system == "x86_64-linux" then "64" else "32"; in stdenv.mkDerivation rec { </ins> pname = "amdvlk"; <del> version = "2020.Q3.4"; </del> <ins> version = "2020.Q3.5"; </ins> src = fetchRepoProject { name = "${pname}-src"; manifest = "https://github.com/GPUOpen-Drivers/AMDVLK.git"; rev = "refs/tags/v-${version}"; <del> sha256 = "13yy1v43wyw2dbanl39sk1798344smmycgvl3gla61ipqls0qfgd"; </del> <ins> sha256 = "08fj3cg3axnwadlpfim23g5nyjl69044fqxdr57af6y79441njay"; </ins> }; buildInputs = [

cmakeDir = "../drivers/xgl"; <ins> # LTO is disabled in gcc for i686 as of #66528 cmakeFlags = stdenv.lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"]; postPatch = stdenv.lib.optionalString stdenv.is32bit '' substituteInPlace drivers/pal/cmake/PalCompilerOptions.cmake  --replace "pal_setup_gcc_ipo()" "" ''; </ins> installPhase = '' <del> install -Dm755 -t $out/lib icd/amdvlk64.so install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd64.json </del> <ins> install -Dm755 -t $out/lib icd/amdvlk${suffix}.so install -Dm644 -t $out/share/vulkan/icd.d ../drivers/AMDVLK/json/Redhat/amd_icd${suffix}.json </ins> <del> substituteInPlace $out/share/vulkan/icd.d/amd_icd64.json --replace  </del> <ins> substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace  </ins> "/usr/lib64" "$out/lib" <ins> substituteInPlace $out/share/vulkan/icd.d/amd_icd${suffix}.json --replace  "/usr/lib" "$out/lib" </ins> <del> patchelf --set-rpath "$rpath" $out/lib/amdvlk64.so </del> <ins> patchelf --set-rpath "$rpath" $out/lib/amdvlk${suffix}.so </ins> ''; # Keep the rpath, otherwise vulkaninfo and vkcube segfault

homepage = "https://github.com/GPUOpen-Drivers/AMDVLK"; changelog = "https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-${version}"; license = licenses.mit; <del> platforms = [ "x86_64-linux" ]; </del> <ins> platforms = [ "x86_64-linux" "i686-linux" ]; </ins> maintainers = with maintainers; [ danieldk Flakebi ]; }; }

# Multi-arch "drivers" which we want to build for i686. driversi686Linux = recurseIntoAttrs { inherit (pkgsi686Linux) <ins> amdvlk </ins> mesa vaapiIntel libvdpau-va-gl