Make it easier to build & run examples on NixOS. (#257)

This commit is contained in:
Eduard-Mihai Burtescu 2020-11-18 16:55:28 +02:00 committed by GitHub
parent 2dd8dba3b0
commit 63b28d057d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

20
default.nix Normal file
View File

@ -0,0 +1,20 @@
let
pkgs = import <nixpkgs> {};
in with pkgs; stdenv.mkDerivation rec {
name = "rust-gpu";
# 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 = [
pkgconfig rustup x11 libxkbcommon
];
# Runtime dependencies.
LD_LIBRARY_PATH = with xlibs; stdenv.lib.makeLibraryPath [
libX11 libXcursor libXi libXrandr vulkan-loader
];
}