This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
66 lines (60 loc) · 1.95 KB
/
flake.nix
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
description = "Has Lily had beffast yet?";
inputs = {
nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
flake-utils.url = github:numtide/flake-utils;
arduino-nix.url = github:clerie/arduino-nix?ref=clerie/arduino-env;
arduino-library-index = {
url = github:bouk/arduino-indexes/library_index;
flake = false;
};
arduino-package-index = {
url = github:bouk/arduino-indexes/package_index;
flake = false;
};
};
outputs = {
self,
nixpkgs,
flake-utils,
arduino-nix,
arduino-package-index,
arduino-library-index,
...
}: let
overlays = [
arduino-nix.overlay
(arduino-nix.mkArduinoPackageOverlay "${arduino-package-index}/package_index.json")
(arduino-nix.mkArduinoPackageOverlay (builtins.fetchTree {
type = "file";
url = "http://raw.githubusercontent.com/SolderedElectronics/Dasduino-Board-Definitions-for-Arduino-IDE/master/package_Dasduino_Boards_index.json";
narHash = "sha256-qMvkUTEMDOFtNBxFwF7bVmJGRekZW7r/GErSEe5PD7o=";
}))
(arduino-nix.mkArduinoLibraryOverlay "${arduino-library-index}/library_index.json")
];
in
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system overlays;};
arduinoEnv = pkgs.mkArduinoEnv {
libraries = with pkgs.arduinoLibraries; [
(arduino-nix.latestVersion InkplateLibrary)
(arduino-nix.latestVersion NTPClient)
];
packages = with pkgs.arduinoPackages; [
(arduino-nix.latestVersion platforms.Inkplate_Boards.esp32)
];
};
in {
formatter = pkgs.alejandra;
packages.default = arduinoEnv.buildArduinoSketch {
name = "beffast";
src = ./. + "/beffast";
fqbn = "Inkplate_Boards:esp32:Inkplate6";
};
devShells.default = pkgs.mkShell {
buildInputs = [arduinoEnv];
};
}
);
}