nixpkgs-suyu/pkgs/tools/misc/esphome/default.nix

55 lines
1.4 KiB
Nix
Raw Normal View History

{ lib, python3, platformio, esptool, git, protobuf3_12, fetchpatch }:
2019-04-05 10:34:33 +02:00
let
python = python3.override {
packageOverrides = self: super: {
2020-01-12 19:07:57 +01:00
protobuf = super.protobuf.override {
protobuf = protobuf3_12;
2020-01-12 19:07:57 +01:00
};
2019-04-05 10:34:33 +02:00
};
};
2019-01-10 19:38:38 +01:00
2019-04-05 10:34:33 +02:00
in python.pkgs.buildPythonApplication rec {
2019-01-18 16:13:58 +01:00
pname = "esphome";
2021-02-04 17:26:41 +01:00
version = "1.16.0";
2019-01-10 19:38:38 +01:00
2019-04-05 10:34:33 +02:00
src = python.pkgs.fetchPypi {
2019-01-10 19:38:38 +01:00
inherit pname version;
2021-02-04 17:26:41 +01:00
sha256 = "0pvwzkdcpjqdf7lh1k3xv1la5v60lhjixzykapl7f2xh71fbm144";
2019-01-10 19:38:38 +01:00
};
2019-01-18 16:13:58 +01:00
ESPHOME_USE_SUBPROCESS = "";
2019-01-10 19:38:38 +01:00
2019-04-05 10:34:33 +02:00
propagatedBuildInputs = with python.pkgs; [
2021-02-04 17:26:41 +01:00
voluptuous pyyaml paho-mqtt colorlog colorama
2019-01-18 16:13:58 +01:00
tornado protobuf tzlocal pyserial ifaddr
protobuf click
2019-01-18 16:13:58 +01:00
];
2020-04-09 20:00:22 +02:00
# remove all version pinning (E.g tornado==5.1.1 -> tornado)
2019-11-02 22:47:53 +01:00
postPatch = ''
sed -i -e "s/==[0-9.]*//" requirements.txt
2019-11-02 22:47:53 +01:00
'';
2019-01-18 16:13:58 +01:00
makeWrapperArgs = [
# platformio is used in esphomeyaml/platformio_api.py
# esptool is used in esphomeyaml/__main__.py
# git is used in esphomeyaml/writer.py
"--prefix PATH : ${lib.makeBinPath [ platformio esptool git ]}"
"--set ESPHOME_USE_SUBPROCESS ''"
2019-01-10 19:38:38 +01:00
];
# Platformio will try to access the network
2020-04-09 20:00:22 +02:00
# Instead, run the executable
checkPhase = ''
$out/bin/esphome --help > /dev/null
'';
2019-01-10 19:38:38 +01:00
meta = with lib; {
description = "Make creating custom firmwares for ESP32/ESP8266 super easy";
2020-04-09 20:00:22 +02:00
homepage = "https://esphome.io/";
2019-01-10 19:38:38 +01:00
license = licenses.mit;
maintainers = with maintainers; [ globin elseym ];
2019-01-10 19:38:38 +01:00
};
}