-
Notifications
You must be signed in to change notification settings - Fork 0
/
esp32.nix
74 lines (66 loc) · 1.38 KB
/
esp32.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
67
68
69
70
71
72
73
74
{ bison
, cmake
, esp-idf
, esptool
, flex
, gcc-xtensa-esp32-elf-bin
, git
, gnumake
, gperf
, ninja
, nixpkgs-esp-dev
, openocd-esp32-bin
, pkgconfig
, wget
, riscvphone-src
, stdenv
, sdkconfig-defaults ? ./sdkconfig.defaults
}:
stdenv.mkDerivation
{
name = "esp32";
src = riscvphone-src;
dontUseCmakeConfigure = true;
dontUseNinjaBuild = true;
dontUseNinjaInstall = true;
dontUseNinjaCheck = true;
PROJECT_VER = riscvphone-src.rev;
LC_ALL = "C";
LC_CTYPE = "C.UTF-8";
configurePhase = ''
cd fw/esp32
# generate an empty sdkconfig file to override the menu prompt.
touch sdkconfig
# copy custom configuration defaults to pass to sdkconfig.
cat ${sdkconfig-defaults} > sdkconfig.defaults
'';
installPhase = ''
mkdir -p $out && cp -r . $out
#make flash
'';
nativeBuildInputs = [
nixpkgs-esp-dev.packages.x86_64-linux.esp-idf
nixpkgs-esp-dev.packages.x86_64-linux.gcc-xtensa-esp32-elf-bin
nixpkgs-esp-dev.packages.x86_64-linux.openocd-esp32-bin
esp-idf
gcc-xtensa-esp32-elf-bin
openocd-esp32-bin
esptool
];
buildInputs = [
nixpkgs-esp-dev.packages.x86_64-linux.esp-idf
git
nixpkgs-esp-dev.packages.x86_64-linux.gcc-xtensa-esp32-elf-bin
nixpkgs-esp-dev.packages.x86_64-linux.openocd-esp32-bin
esptool
git
wget
gnumake
flex
bison
gperf
pkgconfig
cmake
ninja
];
}