Files
rust-gpu/default.nix
firestar99 c41db00890
All checks were successful
Release-plz / Release-plz release (push) Has been skipped
Release-plz / Release-plz PR (push) Has been skipped
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
difftest: unify num-traits features on cpu to prevent rustc_codegen_spirv.so rebuilds
2026-04-24 13:38:50 +00:00

28 lines
915 B
Nix

let
pkgs = import <nixpkgs> {};
in with pkgs; stdenv.mkDerivation rec {
name = "rust-gpu";
# Workaround for https://github.com/NixOS/nixpkgs/issues/60919.
# NOTE(eddyb) needed only in debug mode (warnings about needing optimizations
# turn into errors due to `-Werror`, for at least `spirv-tools-sys`).
hardeningDisable = [ "fortify" ];
# Allow cargo to download crates (even inside `nix-shell --pure`).
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
nativeBuildInputs = [ rustup spirv-tools ];
buildInputs = [ cargo-nextest ];
# Runtime dependencies (for the example runners).
LD_LIBRARY_PATH = with xorg; lib.makeLibraryPath [
vulkan-loader
# NOTE(eddyb) winit really wants `libxkbcommon` on Wayland for some reason
# (see https://github.com/rust-windowing/winit/issues/1760 for more info).
wayland libxkbcommon
libX11 libXcursor libXi libXrandr
];
}