2020-08-07 13:12:58 +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
|
2020-08-09 02:03:47 +08:00
|
|
|
migen = callPackage ./nix/migen.nix {};
|
|
|
|
openocd = callPackage ./nix/openocd.nix {};
|
|
|
|
rustPlatform = callPackage ./nix/rustPlatform.nix {};
|
|
|
|
itm = callPackage ./nix/itm.nix {inherit rustPlatform;};
|
2020-08-07 13:12:58 +08:00
|
|
|
|
|
|
|
runOpenOcdBlock = writeShellScriptBin "run-openocd-block" ''
|
2020-09-10 10:27:52 +08:00
|
|
|
openocd -f openocd/openocd.cfg
|
2020-08-07 13:12:58 +08:00
|
|
|
'';
|
|
|
|
|
2020-09-16 17:45:41 +08:00
|
|
|
openocdFlash = writeShellScriptBin "openocd-flash" ''
|
|
|
|
openocd -f openocd/openocd.cfg -f openocd/$1.cfg
|
|
|
|
'';
|
|
|
|
|
2020-09-23 12:31:10 +08:00
|
|
|
publishMqtt = writeShellScriptBin "publish-mqtt" ''
|
|
|
|
mosquitto_pub -h localhost -t $1 -m "$2" -d
|
|
|
|
'';
|
|
|
|
|
2020-08-07 13:12:58 +08:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2020-09-30 15:57:46 +08:00
|
|
|
name = "Humpback-DDS";
|
2020-08-07 13:12:58 +08:00
|
|
|
buildInputs = with rustPlatform.rust; [
|
2020-08-11 08:54:00 +08:00
|
|
|
(pkgs.python3.withPackages(ps: [ migen ]))
|
2020-08-07 13:12:58 +08:00
|
|
|
pkgs.yosys
|
|
|
|
pkgs.nextpnr
|
|
|
|
pkgs.icestorm
|
|
|
|
pkgs.gdb
|
2020-09-23 10:40:55 +08:00
|
|
|
pkgs.mosquitto
|
2020-08-07 13:12:58 +08:00
|
|
|
openocd
|
|
|
|
rustc
|
|
|
|
cargo
|
|
|
|
itm
|
|
|
|
runOpenOcdBlock
|
2020-09-16 17:45:41 +08:00
|
|
|
openocdFlash
|
2020-09-23 12:31:10 +08:00
|
|
|
publishMqtt
|
2020-08-07 13:12:58 +08:00
|
|
|
];
|
|
|
|
}
|