thermostat/nix/openocd.nix

25 lines
574 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
];
src = ./.;
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
}