nixpkgs/pkgs/servers/home-assistant/esphome.nix

61 lines
1.7 KiB
Nix
Raw Normal View History

2019-11-02 22:47:53 +01:00
{ lib, python3, platformio, esptool, git, protobuf3_10, 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_10;
};
pyyaml = super.pyyaml.overridePythonAttrs (oldAttrs: rec {
version = "5.1.2";
2019-04-05 10:34:33 +02:00
src = oldAttrs.src.override {
inherit version;
2020-01-12 19:07:57 +01:00
sha256 = "1r5faspz73477hlbjgilw05xsms0glmsa371yqdd26znqsvg1b81";
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";
2020-01-12 19:07:57 +01:00
version = "1.14.3";
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;
2020-01-12 19:07:57 +01:00
sha256 = "0xnsl000c5a2li9qw9anrzzq437qn1n4hcfc24i4rfq37awzmig7";
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; [
2019-01-10 19:38:38 +01:00
voluptuous pyyaml paho-mqtt colorlog
2019-01-18 16:13:58 +01:00
tornado protobuf tzlocal pyserial ifaddr
2019-11-02 22:47:53 +01:00
protobuf
2019-01-18 16:13:58 +01:00
];
2019-11-02 22:47:53 +01:00
postPatch = ''
substituteInPlace setup.py \
--replace "protobuf==3.10.0" "protobuf~=3.10" \
--replace "paho-mqtt==1.4.0" "paho-mqtt~=1.4" \
--replace "tornado==5.1.1" "tornado~=5.1"
'';
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
doCheck = false;
meta = with lib; {
description = "Make creating custom firmwares for ESP32/ESP8266 super easy";
2019-01-18 16:13:58 +01:00
homepage = https://esphome.io/;
2019-01-10 19:38:38 +01:00
license = licenses.mit;
maintainers = with maintainers; [ dotlambda globin ];
2019-01-10 19:38:38 +01:00
};
}