nix: simplify the vulkan-loader linking

This commit is contained in:
2022-07-06 00:38:47 -07:00
parent 5f03cfbec0
commit a61f7f4822

View File

@@ -36,13 +36,9 @@
# enables debug builds, if we want: https://github.com/NixOS/nixpkgs/issues/60919. # enables debug builds, if we want: https://github.com/NixOS/nixpkgs/issues/60919.
hardeningDisable = [ "fortify" ]; hardeningDisable = [ "fortify" ];
postFixup = let preFixup = ''
libPath = nixpkgs.lib.makeLibraryPath [ pkgs.vulkan-loader ];
in ''
# strictly speaking not *all* binaries need this, but this is easy. # strictly speaking not *all* binaries need this, but this is easy.
# might be better to use `wrapProgram`, not sure. patchelf --add-needed ${pkgs.vulkan-loader}/lib/libvulkan.so.1 $out/bin/*
echo adding rpath "${libPath}"
patchelf --add-rpath "${libPath}" $out/bin/*
''; '';
}; };
}; };