forked from M-Labs/humpback-dds
nix: simplify
This commit is contained in:
parent
430fc12f54
commit
d202886753
22
shell.nix
22
shell.nix
@ -8,28 +8,10 @@ let
|
|||||||
rustPlatform = callPackage ./nix/rustPlatform.nix {};
|
rustPlatform = callPackage ./nix/rustPlatform.nix {};
|
||||||
itm = callPackage ./nix/itm.nix {inherit rustPlatform;};
|
itm = callPackage ./nix/itm.nix {inherit rustPlatform;};
|
||||||
|
|
||||||
runOpenOcd = writeShellScriptBin "run-openocd" ''
|
|
||||||
openocd \
|
|
||||||
-f openocd/openocd.cfg \
|
|
||||||
-c init &
|
|
||||||
sleep 1
|
|
||||||
'';
|
|
||||||
|
|
||||||
runOpenOcdBlock = writeShellScriptBin "run-openocd-block" ''
|
runOpenOcdBlock = writeShellScriptBin "run-openocd-block" ''
|
||||||
openocd -f openocd/openocd.cfg
|
openocd -f openocd/openocd.cfg
|
||||||
'';
|
'';
|
||||||
|
|
||||||
setGDBConfigFile = writeShellScriptBin "set-gdb-config-file" ''
|
|
||||||
if [[ $1 == "" ]]
|
|
||||||
then
|
|
||||||
sed -i "2s/.*/runner = \"gdb -q -x gdb_config\/openocd.gdb\"/" .cargo/config
|
|
||||||
echo "GDB config file: openocd.gdb"
|
|
||||||
else
|
|
||||||
sed -i "2s/.*/runner = \"gdb -q -x gdb_config\/$1.gdb\"/" .cargo/config
|
|
||||||
echo "GDB config file: $1.gdb"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
openocdFlash = writeShellScriptBin "openocd-flash" ''
|
openocdFlash = writeShellScriptBin "openocd-flash" ''
|
||||||
openocd -f openocd/openocd.cfg -f openocd/$1.cfg
|
openocd -f openocd/openocd.cfg -f openocd/$1.cfg
|
||||||
'';
|
'';
|
||||||
@ -40,7 +22,7 @@ let
|
|||||||
|
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "nix-shell";
|
name = "Humpback-DDS";
|
||||||
buildInputs = with rustPlatform.rust; [
|
buildInputs = with rustPlatform.rust; [
|
||||||
(pkgs.python3.withPackages(ps: [ migen ]))
|
(pkgs.python3.withPackages(ps: [ migen ]))
|
||||||
pkgs.yosys
|
pkgs.yosys
|
||||||
@ -52,9 +34,7 @@ in
|
|||||||
rustc
|
rustc
|
||||||
cargo
|
cargo
|
||||||
itm
|
itm
|
||||||
runOpenOcd
|
|
||||||
runOpenOcdBlock
|
runOpenOcdBlock
|
||||||
setGDBConfigFile
|
|
||||||
openocdFlash
|
openocdFlash
|
||||||
publishMqtt
|
publishMqtt
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user