tnetplug/nix/openocd.nix

25 lines
578 B
Nix
Raw Normal View History

{ stdenv, lib, openocd, makeWrapper }:
2019-03-08 01:24:21 +08:00
stdenv.mkDerivation {
name = "openocd-nucleo-f429zi";
buildInputs = [
openocd
makeWrapper
2019-03-08 01:24:21 +08:00
];
2019-05-10 02:58:11 +08:00
src = openocd;
2019-03-08 01:24:21 +08:00
noBuild = true;
installPhase =
let
openOcdFlags = [
"-f" "${openocd}/share/openocd/scripts/interface/stlink-v2-1.cfg"
"-f" "${openocd}/share/openocd/scripts/target/stm32f4x.cfg"
"-c" "init"
];
in ''
mkdir -p $out/bin
makeWrapper ${openocd}/bin/openocd $out/bin/openocd-nucleo-f429zi \
--add-flags "${lib.escapeShellArgs openOcdFlags}"
'';
2019-03-08 01:24:21 +08:00
}