From 575e958657a50dfe3d335e6af9489c0bea246a4b Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 10 Oct 2021 22:19:37 +0200 Subject: Add loader commands e.g. "nix run .#flash-ulisp" flashes ulisp to the attached Teensy 4.0 board --- build.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'build.nix') diff --git a/build.nix b/build.nix index 3770d57..c670866 100644 --- a/build.nix +++ b/build.nix @@ -27,4 +27,15 @@ cp *.hex $out/ ''; }; + + flash = let + loader = name: path: pkgs.writeScript name '' + #!/bin/sh + ${pkgs.teensy-loader-cli}/bin/teensy-loader-cli --mcu=TEENSY40 -w ${path} + ''; + + in drv: file: { + type = "app"; + program = ''${loader file "${drv}/${file}.hex"}''; + }; } -- cgit v1.2.3