1
0
forked from M-Labs/thermostat
thermostat/nix/openocd.nix
2019-03-07 18:24:21 +01:00

23 lines
511 B
Nix

{ stdenv, openocd }:
stdenv.mkDerivation {
name = "openocd-nucleo-f429zi";
buildInputs = [
openocd
];
src = ./.;
noBuild = true;
installPhase = ''
mkdir -p $out/bin
cat >> $out/bin/openocd-nucleo-f429zi <<EOF
#!/usr/bin/env bash
${openocd}/bin/openocd \
-f ${openocd}/share/openocd/scripts/interface/stlink-v2-1.cfg \
-f ${openocd}/share/openocd/scripts/target/stm32f4x.cfg \
-c "init" \
"\$@"
EOF
chmod +x $out/bin/openocd-nucleo-f429zi
'';
}