fixup the shell so that binaries can be run as expected under it

This commit is contained in:
2022-07-04 01:58:05 -07:00
parent 16f3145890
commit 7c6676a942

View File

@@ -21,7 +21,14 @@
# docs: https://github.com/oxalica/rust-overlay
coremem-wavefront = pkgs.rustPlatform.buildRustPackage {
name = "coremem-wavefront";
nativeBuildInputs = [ rust-toolchain ];
# buildInputs = [ pkgs.vulkan-loader ];
buildInputs = with pkgs; [
pkgconfig
mesa
xlibsWrapper xorg.libXcursor xorg.libXrandr xorg.libXi
vulkan-tools vulkan-headers vulkan-loader vulkan-validation-layers
];
nativeBuildInputs = [ rust-toolchain pkgs.pkgconfig pkgs.mesa pkgs.vulkan-loader ];
src = self;
cargoLock = {
lockFile = ./Cargo.lock;
@@ -32,18 +39,38 @@
# rgpu tests expectedly fail due to a lack of spirv adapter exposed to the builder.
doCheck = false;
hardeningDisable = [ "fortify" ];
# i guess the proper fix for this is to split rustc_codegen_spirv into its own
# package (see how we're also special-casing it in cargoLock), but this suffices too.
postInstall = ''
cp $releaseDir/deps/librustc_codegen_spirv-*.so $out/lib/
'';
LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath [ pkgs.vulkan-loader ];
};
};
defaultPackage = packages.coremem-wavefront;
devShells.default = pkgs.mkShell {
devShells.default = with pkgs; mkShell {
# buildInputs = with pkgs; [
# rust-toolchain vulkan-loader
# ];
# hardeningDisable = [ "fortify" ];
# Workaround for https://github.com/NixOS/nixpkgs/issues/60919.
hardeningDisable = [ "fortify" ];
# Allow cargo to download crates.
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
buildInputs = [
rust-toolchain
pkgconfig rustup xlibsWrapper libxkbcommon
];
# Runtime dependencies.
LD_LIBRARY_PATH = with xorg; lib.makeLibraryPath [
libX11 libXcursor libXi libXrandr vulkan-loader
];
};
});