thermostat/nix/openocd.nix
2019-05-09 20:58:11 +02:00

25 lines
578 B
Nix

{ stdenv, lib, openocd, makeWrapper }:
stdenv.mkDerivation {
name = "openocd-nucleo-f429zi";
buildInputs = [
openocd
makeWrapper
];
src = openocd;
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}"
'';
}