Skip to content
Snippets Groups Projects
Commit a1dce27c authored by fxk8y's avatar fxk8y :spider:
Browse files

make qthing ready for NixOS

parent 18cfc4c6
No related branches found
No related tags found
1 merge request!10make qthing ready for NixOS
{ nixpkgs ? import <nixpkgs> {} }:
let
inherit (nixpkgs) pkgs;
in
pkgs.stdenv.mkDerivation {
name = "esp-idf-env";
buildInputs = with pkgs; [
gawk gperf gettext automake bison flex texinfo help2man libtool autoconf ncurses5 bash
(python2.withPackages (ppkgs: with ppkgs; [ pyserial future cryptography pyelftools click ]))
(python3.withPackages (ppkgs: with ppkgs; [ paho-mqtt ]))
(pkgs.callPackage ./esp32-toolchain.nix {})
];
shellHook = ''
export NIX_CFLAGS_LINK=-lncurses
export IDF_PATH=./esp-idf
'';
}
{ stdenv, fetchurl, makeWrapper, buildFHSUserEnv }:
let
fhsEnv = buildFHSUserEnv {
name = "esp32-toolchain-env";
targetPkgs = pkgs: with pkgs; [ zlib ];
runScript = "";
};
in
stdenv.mkDerivation rec {
name = "esp32-toolchain";
version = "1.22.0";
src = fetchurl {
url = "https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz";
sha256 = "0mji8jq1dg198z8bl50i0hs3drdqa446kvf6xpjx9ha63lanrs9z";
};
buildInputs = [ makeWrapper ];
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
cp -r . $out
for FILE in $(ls $out/bin); do
FILE_PATH="$out/bin/$FILE"
if [[ -x $FILE_PATH ]]; then
mv $FILE_PATH $FILE_PATH-unwrapped
makeWrapper ${fhsEnv}/bin/esp32-toolchain-env $FILE_PATH --add-flags "$FILE_PATH-unwrapped"
fi
done
'';
meta = with stdenv.lib; {
description = "ESP32 toolchain";
homepage = https://docs.espressif.com/projects/esp-idf/en/stable/get-started/linux-setup.html;
license = licenses.gpl3;
};
}
#!/usr/bin/python3
#!/usr/bin/env python3
# TODO: read from header?
BROKER = "mqtt.c3pb.hack"
......
#!/bin/bash
#!/usr/bin/env bash
set -e
......
#!/bin/bash
#!/usr/bin/env bash
set -e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment