tnetplug/shell.nix

31 lines
716 B
Nix
Raw Normal View History

2019-03-07 23:27:33 +08:00
{ rustChannel ? "nightly" }:
let
mozillaOverlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
2019-03-07 23:27:33 +08:00
in
with pkgs;
2019-03-07 23:27:33 +08:00
let
2019-03-22 20:34:32 +08:00
rustPlatform = callPackage ./nix/rustPlatform.nix {};
openocd = callPackage ./nix/openocd.nix {};
2019-03-07 23:27:33 +08:00
in
stdenv.mkDerivation {
2019-12-01 17:03:02 +08:00
name = "tnetplug-env";
2019-03-07 23:27:33 +08:00
buildInputs = with rustPlatform.rust; [
rustc cargo pkgs.gdb
2019-03-07 23:27:33 +08:00
];
# Set Environment Variables
RUST_BACKTRACE = 1;
2019-03-08 01:24:21 +08:00
shellHook = ''
echo "Starting openocd"
${openocd}/bin/openocd-nucleo-f429zi &
# Let openocd output scroll by
sleep 1
2019-03-20 00:16:45 +08:00
echo "Run 'cargo run --release --features=semihosting'"
2019-03-08 01:24:21 +08:00
'';
2019-03-07 23:27:33 +08:00
}