1 { fetchFromGitHub, fetchurl, lib, python3Packages
2 , coreVersion ? "1.13.3" # the version of the binary espurna image to flash
3 , coreSize ? "1MB" # size of the binary image to flash
4 , coreSha256 ? "0pkb2nmml0blrfiqpc46xpjc2dw927i89k1lfyqx827wanhc704x" }:
10 url = "https://github.com/xoseperez/espurna/releases/download/${coreVersion}/espurna-${coreVersion}-espurna-core-${coreSize}.bin";
14 in buildPythonApplication rec {
15 pname = "sonota-unstable";
16 version = "2018-10-07";
18 src = fetchFromGitHub {
21 rev = "d7f4b353858aae7ac403f95475a35560fb7ffeae";
22 sha256 = "0jd9xrhcyk8d2plbjnrlpn87536zr6n708797n0k5blf109q3c1z";
26 ./set_resource_path.patch
30 substituteInPlace sonota.py --subst-var out
35 propagatedBuildInputs = [ httplib2 netifaces tornado ];
40 install -Dm755 sonota.py $out/bin/sonota
41 install -d $out/share/sonota
42 cp -r ssl static $out/share/sonota
43 cp ${core} $out/share/sonota/static/image_arduino.bin
49 description = "Flash Itead Sonoff devices with custom firmware via original OTA mechanism";
50 homepage = src.meta.homepage;
51 license = licenses.gpl2;
52 maintainers = with maintainers; [ peterhoeg ];