diff --git a/openocd.nix b/openocd.nix index 5ba9e98490ff064e9fd918844bcc935687a7bd2d..dcad7ece56610bd88f2a1e63bcc453949226bcd5 100644 --- a/openocd.nix +++ b/openocd.nix @@ -16,16 +16,25 @@ let ]; enableParallelBuilding = true; }); + card10-scripts = stdenv.mkDerivation { + name = "card10-scripts"; + src = ./c/openocd/scripts; + dontBuild = true; + installPhase = '' + mkdir -p $out/share/openocd + cp -ar . $out/share/openocd/scripts + ''; + }; in stdenv.mkDerivation { name = "openocd-card10"; src = maxim-openocd; phases = [ "unpackPhase" "installPhase" ]; - buildInputs = [ maxim-openocd makeWrapper ]; + buildInputs = [ makeWrapper maxim-openocd card10-scripts ]; installPhase = '' mkdir -p $out/bin makeWrapper ${maxim-openocd}/bin/openocd $out/bin/openocd-card10 \ - --add-flags "-f ${maxim-openocd}/share/openocd/scripts/interface/cmsis-dap.cfg" \ - --add-flags "-f ${maxim-openocd}/share/openocd/scripts/target/max32665.cfg" + --add-flags "-f ${card10-scripts}/share/openocd/scripts/interface/cmsis-dap.cfg" \ + --add-flags "-f ${card10-scripts}/share/openocd/scripts/target/max32665.cfg" ''; } diff --git a/shell.nix b/shell.nix index 375e9f080b8eb2bfcbee8218010b4ff67a85228e..bbe26cfcc9363aec31fed96dcfdc610d346e6dac 100644 --- a/shell.nix +++ b/shell.nix @@ -21,6 +21,6 @@ stdenv.mkDerivation { # Let openocd output scroll by sleep 1 - echo "Run 'cargo run --release'" + echo "Run 'cargo run --release watchapp'" ''; }