summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.nix11
-rw-r--r--flake.nix6
2 files changed, 17 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"}'';
+ };
}
diff --git a/flake.nix b/flake.nix
index 43e8824..b2c2111 100644
--- a/flake.nix
+++ b/flake.nix
@@ -25,5 +25,11 @@
packages.${system} = {
inherit teensy-core teensy-test teensy-ulisp;
};
+
+ apps.${system} = {
+ flash-blink = image.flash teensy-test "blink";
+ flash-counter = image.flash teensy-test "counter";
+ flash-ulisp = image.flash teensy-ulisp "ulisp-arm";
+ };
};
}