summaryrefslogtreecommitdiff
path: root/build.nix
diff options
context:
space:
mode:
Diffstat (limited to 'build.nix')
-rw-r--r--build.nix11
1 files changed, 11 insertions, 0 deletions
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"}'';
+ };
}