Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions esp-idf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
let
version = "v4.1-dev";

pypkgs = python-packages: with python-packages; [
pyserial
click
cryptography
future
pyparsing
pyelftools
setuptools
];
pypkgs = python-packages:
with python-packages; [
pyserial
click
cryptography
future
pyparsing
pyelftools
setuptools
];
python = pkgs.python2.withPackages pypkgs;

in stdenv.mkDerivation rec {
Expand All @@ -20,14 +21,12 @@ in stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "espressif";
repo = "esp-idf";
rev = "${version}";
rev = "${version}";
fetchSubmodules = true;
sha256 = "0d1iqxz1jqz3rrk2c5dq33wp1v71d9190wv3bnigxlp5kcsj0j1w";
};

buildInputs = [
python
];
buildInputs = [ python ];

propagatedBuildInputs = [
pkgs.cmake
Expand All @@ -50,7 +49,8 @@ in stdenv.mkDerivation rec {

meta = with stdenv.lib; {
description = "ESP IDF";
homepage = https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html;
homepage =
"https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html";
license = licenses.gpl3;
};
}
9 changes: 5 additions & 4 deletions esp32-toolchain.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ let
targetPkgs = pkgs: with pkgs; [ zlib ];
runScript = "";
};
in

stdenv.mkDerivation rec {
in stdenv.mkDerivation rec {
name = "esp32-toolchain";
version = "2019r2";

src = fetchurl {
# https://github.com/espressif/esp-idf/blob/release/v4.1/tools/tools.json#L27
url = "https://dl.espressif.com/dl/xtensa-esp32-elf-gcc8_2_0-esp-2019r2-linux-amd64.tar.gz";
url =
"https://dl.espressif.com/dl/xtensa-esp32-elf-gcc8_2_0-esp-2019r2-linux-amd64.tar.gz";
sha256 = "1pzv1r9kzizh5gi3gsbs6jg8rs1yqnmf5rbifbivz34cplfprm76";
};

Expand All @@ -35,7 +35,8 @@ stdenv.mkDerivation rec {

meta = with stdenv.lib; {
description = "ESP32 toolchain";
homepage = https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html;
homepage =
"https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html";
license = licenses.gpl3;
};
}
29 changes: 11 additions & 18 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
{ pkgs ? import <nixpkgs> {} }:
let
esp-idf = (pkgs.callPackage ./esp-idf.nix {});
esp32-toolchain = (pkgs.callPackage ./esp32-toolchain.nix {});
in
pkgs.mkShell {
buildInputs = [
esp-idf
esp32-toolchain
];
shellHook = ''
set -e

export IDF_PATH=${esp-idf}

export NIX_CFLAGS_LINK=-lncurses
export PATH=$PATH:$IDF_PATH/tools
'';
{ pkgs ? import <nixpkgs> { } }:
let
esp-idf = (pkgs.callPackage ./esp-idf.nix { });
esp32-toolchain = (pkgs.callPackage ./esp32-toolchain.nix { });
in pkgs.mkShell {
buildInputs = [ esp-idf esp32-toolchain ];
shellHook = ''
export IDF_PATH="${esp-idf.outPath}"
export NIX_CFLAGS_LINK=-lncurses
export PATH=$PATH:$IDF_PATH/tools
'';
}