summaryrefslogtreecommitdiff
path: root/flake.nix
blob: b2c211168a89ad4a103c0ba4a7be5338917c7587 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
  description = "Build environment for Teensy 4.0";

  inputs = {
    nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05;
  };

  outputs = { self, nixpkgs, ... }: let
    system = "x86_64-linux";
    pkgs = import nixpkgs { inherit system; };

    teensy-core  = import ./core.nix { inherit pkgs; };

    image = import ./build.nix { inherit pkgs teensy-core; };

    teensy-test  = image.build "teensy-test" ./test;

    teensy-ulisp = let
      ulisp-source = import ./ulisp.nix { inherit pkgs; };
    in image.build
      "teensy-ulisp"
      (pkgs.linkFarmFromDrvs "ulisp" [ ulisp-source ]);

  in {
    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";
    };
  };
}