From 63b28d057dc4d71b6ed54d1fde76decbad91f548 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 18 Nov 2020 16:55:28 +0200 Subject: [PATCH] Make it easier to build & run examples on NixOS. (#257) --- default.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 default.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000000..52a00cbef1 --- /dev/null +++ b/default.nix @@ -0,0 +1,20 @@ +let + pkgs = import {}; +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 + ]; +}