2019-05-05 20:56:23 +08:00
|
|
|
let
|
|
|
|
mozillaOverlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
|
|
|
|
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
|
|
|
|
in
|
|
|
|
with pkgs;
|
|
|
|
let
|
|
|
|
project = callPackage ./default.nix {};
|
|
|
|
in
|
|
|
|
with project;
|
|
|
|
stdenv.mkDerivation {
|
2019-08-30 16:14:23 +08:00
|
|
|
name = "zynq-env";
|
|
|
|
buildInputs = (with rustPlatform.rust; [
|
2019-05-05 20:56:23 +08:00
|
|
|
rustc cargo
|
2019-08-07 01:47:45 +08:00
|
|
|
cargo-xbuild rustcSrc
|
2019-09-26 23:54:37 +08:00
|
|
|
gcc
|
2020-03-06 18:37:15 +08:00
|
|
|
]) ++ (with pkgs; [ openocd gdb cgdb tcl ]);
|
2019-05-05 20:56:23 +08:00
|
|
|
|
|
|
|
# Set Environment Variables
|
|
|
|
RUST_BACKTRACE = 1;
|
2019-08-07 01:47:45 +08:00
|
|
|
XARGO_RUST_SRC = "${rustcSrc}/src";
|
2019-05-05 20:56:23 +08:00
|
|
|
|
|
|
|
shellHook = ''
|
2019-08-07 01:47:45 +08:00
|
|
|
echo "Run 'cargo xbuild --release' to build."
|
2019-05-05 20:56:23 +08:00
|
|
|
'';
|
|
|
|
}
|