From 1e839fd76690564b197668b86c28c485c9543f68 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Mon, 15 Jul 2024 13:02:57 +0200 Subject: [PATCH] feat(deye): initial solar support --- config/runtime.exs | 6 + deps.nix | 428 +++++++++++++++++++++++++++++++++ flake.lock | 102 +++----- flake.nix | 20 +- lib/weewx_proxy/modbus/deye.ex | 97 ++++++++ lib/weewx_proxy/mqtt.ex | 16 +- mix.exs | 13 +- mix.lock | 31 +-- mix.nix | 364 ---------------------------- 9 files changed, 601 insertions(+), 476 deletions(-) create mode 100644 deps.nix create mode 100644 lib/weewx_proxy/modbus/deye.ex delete mode 100644 mix.nix diff --git a/config/runtime.exs b/config/runtime.exs index e573806..80a19c2 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -11,4 +11,10 @@ config :weewx_proxy, mqtt_sdr_user: System.fetch_env!("WEEWX_PROXY_MQTT_SDR_USER"), mqtt_sdr_password: System.fetch_env!("WEEWX_PROXY_MQTT_SDR_PASSWORD"), mqtt_sdr_client_id: String.to_atom("Elixir." <> System.get_env("WEEWX_PROXY_MQTT_SDR_CLIENT_ID", "SdrIngestLocal")), + mqtt_modbus_host: elem(:inet.parse_address(to_charlist(System.fetch_env!("WEEWX_PROXY_MQTT_MODBUS_HOST"))), 1), + mqtt_modbus_port: elem(Integer.parse(System.get_env("WEEWX_PROXY_MQTT_MODBUS_PORT", "1884")), 0), + mqtt_modbus_user: System.fetch_env!("WEEWX_PROXY_MQTT_MODBUS_USER"), + mqtt_modbus_password: System.fetch_env!("WEEWX_PROXY_MQTT_MODBUS_PASSWORD"), + mqtt_modbus_client_id: + String.to_atom("Elixir." <> System.get_env("WEEWX_PROXY_MQTT_MODBUS_CLIENT_ID", "ModbusIngestLocal")), purpleair_url: System.fetch_env!("WEEWX_PROXY_PURPLEAIR_URL") diff --git a/deps.nix b/deps.nix new file mode 100644 index 0000000..fb84ae0 --- /dev/null +++ b/deps.nix @@ -0,0 +1,428 @@ +{ lib, beamPackages, overrides ? (x: y: { }) }: + +let + buildMix = lib.makeOverridable beamPackages.buildMix; + buildRebar3 = lib.makeOverridable beamPackages.buildRebar3; + + defaultOverrides = (final: prev: + + let + apps = { }; + + workarounds = { }; + + applyOverrides = appName: drv: + let + allOverridesForApp = builtins.foldl' + (acc: workaround: acc // workarounds.${workaround} drv) + { } + apps.${appName}; + + in + if builtins.hasAttr appName apps + then + drv.override allOverridesForApp + else + drv; + + in + builtins.mapAttrs applyOverrides prev); + + self = packages // (defaultOverrides self packages) // (overrides self packages); + + packages = with beamPackages; with self; { + certifi = + let + version = "2.12.0"; + in + buildRebar3 { + inherit version; + name = "certifi"; + + src = fetchHex { + inherit version; + pkg = "certifi"; + sha256 = "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"; + }; + }; + + cowboy = + let + version = "2.12.0"; + in + buildRebar3 { + inherit version; + name = "cowboy"; + + src = fetchHex { + inherit version; + pkg = "cowboy"; + sha256 = "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"; + }; + + beamDeps = [ cowlib ranch ]; + }; + + cowboy_telemetry = + let + version = "0.4.0"; + in + buildRebar3 { + inherit version; + name = "cowboy_telemetry"; + + src = fetchHex { + inherit version; + pkg = "cowboy_telemetry"; + sha256 = "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"; + }; + + beamDeps = [ cowboy telemetry ]; + }; + + cowlib = + let + version = "2.13.0"; + in + buildRebar3 { + inherit version; + name = "cowlib"; + + src = fetchHex { + inherit version; + pkg = "cowlib"; + sha256 = "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"; + }; + }; + + enough = + let + version = "0.1.0"; + in + buildRebar3 { + inherit version; + name = "enough"; + + src = fetchHex { + inherit version; + pkg = "enough"; + sha256 = "0460c7abda5f5e0ea592b12bc6976b8a5c4b96e42f332059cd396525374bf9a1"; + }; + }; + + gen_state_machine = + let + version = "3.0.0"; + in + buildMix { + inherit version; + name = "gen_state_machine"; + + src = fetchHex { + inherit version; + pkg = "gen_state_machine"; + sha256 = "0a59652574bebceb7309f6b749d2a41b45fdeda8dbb4da0791e355dd19f0ed15"; + }; + }; + + hackney = + let + version = "1.20.1"; + in + buildRebar3 { + inherit version; + name = "hackney"; + + src = fetchHex { + inherit version; + pkg = "hackney"; + sha256 = "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"; + }; + + beamDeps = [ certifi idna metrics mimerl parse_trans ssl_verify_fun unicode_util_compat ]; + }; + + httpoison = + let + version = "2.2.1"; + in + buildMix { + inherit version; + name = "httpoison"; + + src = fetchHex { + inherit version; + pkg = "httpoison"; + sha256 = "51364e6d2f429d80e14fe4b5f8e39719cacd03eb3f9a9286e61e216feac2d2df"; + }; + + beamDeps = [ hackney ]; + }; + + idna = + let + version = "6.1.1"; + in + buildRebar3 { + inherit version; + name = "idna"; + + src = fetchHex { + inherit version; + pkg = "idna"; + sha256 = "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"; + }; + + beamDeps = [ unicode_util_compat ]; + }; + + jason = + let + version = "1.4.3"; + in + buildMix { + inherit version; + name = "jason"; + + src = fetchHex { + inherit version; + pkg = "jason"; + sha256 = "9a90e868927f7c777689baa16d86f4d0e086d968db5c05d917ccff6d443e58a3"; + }; + }; + + metrics = + let + version = "1.0.1"; + in + buildRebar3 { + inherit version; + name = "metrics"; + + src = fetchHex { + inherit version; + pkg = "metrics"; + sha256 = "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"; + }; + }; + + mime = + let + version = "2.0.6"; + in + buildMix { + inherit version; + name = "mime"; + + src = fetchHex { + inherit version; + pkg = "mime"; + sha256 = "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"; + }; + }; + + mimerl = + let + version = "1.3.0"; + in + buildRebar3 { + inherit version; + name = "mimerl"; + + src = fetchHex { + inherit version; + pkg = "mimerl"; + sha256 = "a1e15a50d1887217de95f0b9b0793e32853f7c258a5cd227650889b38839fe9d"; + }; + }; + + parse_trans = + let + version = "3.4.1"; + in + buildRebar3 { + inherit version; + name = "parse_trans"; + + src = fetchHex { + inherit version; + pkg = "parse_trans"; + sha256 = "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"; + }; + }; + + plug = + let + version = "1.16.1"; + in + buildMix { + inherit version; + name = "plug"; + + src = fetchHex { + inherit version; + pkg = "plug"; + sha256 = "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"; + }; + + beamDeps = [ mime plug_crypto telemetry ]; + }; + + plug_cowboy = + let + version = "2.7.1"; + in + buildMix { + inherit version; + name = "plug_cowboy"; + + src = fetchHex { + inherit version; + pkg = "plug_cowboy"; + sha256 = "02dbd5f9ab571b864ae39418db7811618506256f6d13b4a45037e5fe78dc5de3"; + }; + + beamDeps = [ cowboy cowboy_telemetry plug ]; + }; + + plug_crypto = + let + version = "2.1.0"; + in + buildMix { + inherit version; + name = "plug_crypto"; + + src = fetchHex { + inherit version; + pkg = "plug_crypto"; + sha256 = "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"; + }; + }; + + ranch = + let + version = "1.8.0"; + in + buildRebar3 { + inherit version; + name = "ranch"; + + src = fetchHex { + inherit version; + pkg = "ranch"; + sha256 = "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"; + }; + }; + + ssl_verify_fun = + let + version = "1.1.7"; + in + buildMix { + inherit version; + name = "ssl_verify_fun"; + + src = fetchHex { + inherit version; + pkg = "ssl_verify_fun"; + sha256 = "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"; + }; + }; + + systemd = + let + version = "0.6.2"; + in + buildRebar3 { + inherit version; + name = "systemd"; + + src = fetchHex { + inherit version; + pkg = "systemd"; + sha256 = "5062b911800c1ab05157c7bf9a9fbe23dd24c58891c87fd12d2e3ed8fc1708b8"; + }; + + beamDeps = [ enough ]; + }; + + telemetry = + let + version = "1.2.1"; + in + buildRebar3 { + inherit version; + name = "telemetry"; + + src = fetchHex { + inherit version; + pkg = "telemetry"; + sha256 = "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"; + }; + }; + + tortoise311 = + let + version = "0.11.7"; + in + buildMix { + inherit version; + name = "tortoise311"; + + src = fetchHex { + inherit version; + pkg = "tortoise311"; + sha256 = "0ef7cf940b50ab47c433323294c9a3bb2883a03e0c7cb37de3e860c0b9ba5bef"; + }; + + beamDeps = [ gen_state_machine telemetry ]; + }; + + typed_struct = + let + version = "0.3.0"; + in + buildMix { + inherit version; + name = "typed_struct"; + + src = fetchHex { + inherit version; + pkg = "typed_struct"; + sha256 = "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"; + }; + }; + + tz = + let + version = "0.26.5"; + in + buildMix { + inherit version; + name = "tz"; + + src = fetchHex { + inherit version; + pkg = "tz"; + sha256 = "c4f9392d710582c7108b6b8c635f4981120ec4b2072adbd242290fc842338183"; + }; + }; + + unicode_util_compat = + let + version = "0.7.0"; + in + buildRebar3 { + inherit version; + name = "unicode_util_compat"; + + src = fetchHex { + inherit version; + pkg = "unicode_util_compat"; + sha256 = "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"; + }; + }; + }; +in +self diff --git a/flake.lock b/flake.lock index 2741d13..73fb16f 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, - "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "owner": "edolstra", "repo": "flake-compat", - "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1693611461, - "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "flake-root": { "locked": { - "lastModified": 1692742795, - "narHash": "sha256-f+Y0YhVCIJ06LemO+3Xx00lIcqQxSKJHXT/yk1RTKxw=", + "lastModified": 1713493429, + "narHash": "sha256-ztz8JQkI08tjKnsTpfLqzWoKFQF4JGu2LRz8bkdnYUk=", "owner": "srid", "repo": "flake-root", - "rev": "d9a70d9c7a5fd7f3258ccf48da9335e9b47c3937", + "rev": "bc748b93b86ee76e2032eecda33440ceb2532fcd", "type": "github" }, "original": { @@ -49,24 +49,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -74,11 +56,11 @@ ] }, "locked": { - "lastModified": 1694102001, - "narHash": "sha256-vky6VPK1n1od6vXbqzOXnekrQpTL4hbPAwUhT5J9c9E=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "9e21c80adf67ebcb077d75bd5e7d724d21eeafd6", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -89,11 +71,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1694593561, - "narHash": "sha256-WSaIQZ5s9N9bDFkEMTw6P9eaZ9bv39ZhsiW12GtTNM0=", + "lastModified": 1720657034, + "narHash": "sha256-nPhbeFdyN8yn+EXmnPcBWisoypndtQbNIhSKmAinv3E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1697b7d480449b01111e352021f46e5879e47643", + "rev": "212defe037698e18fc9521dfe451779a8979844c", "type": "github" }, "original": { @@ -105,34 +87,28 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1693471703, - "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", - "type": "github" + "lastModified": 1719876945, + "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, - "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "lastModified": 1720386169, + "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05", + "ref": "nixos-24.05", "repo": "nixpkgs", "type": "github" } @@ -140,7 +116,6 @@ "pre-commit-hooks-nix": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": "flake-utils", "gitignore": [ "gitignore" ], @@ -150,11 +125,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1694364351, - "narHash": "sha256-oadhSCqopYXxURwIA6/Anpe5IAG11q2LhvTJNP5zE6o=", + "lastModified": 1720524665, + "narHash": "sha256-ni/87oHPZm6Gv0ECYxr1f6uxB0UKBWJ6HvS7lwLU6oY=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "4f883a76282bc28eb952570afc3d8a1bf6f481d7", + "rev": "8d6a17d0cdf411c55f12602624df6368ad86fac1", "type": "github" }, "original": { @@ -173,21 +148,6 @@ "treefmt-nix": "treefmt-nix" } }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -195,11 +155,11 @@ ] }, "locked": { - "lastModified": 1694528738, - "narHash": "sha256-aWMEjib5oTqEzF9f3WXffC1cwICo6v/4dYKjwNktV8k=", + "lastModified": 1720645794, + "narHash": "sha256-vAeYp+WH7i/DlBM5xNt9QeWiOiqzzf5abO8DYGkbUxg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "7a49c388d7a6b63bb551b1ddedfa4efab8f400d8", + "rev": "750dfb555b5abdab4d3266b3f9a05dec6d205c04", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 041f35f..cccd603 100644 --- a/flake.nix +++ b/flake.nix @@ -41,16 +41,9 @@ pname = "weewx-proxy"; version = "0.0.1"; - erlang = pkgs.beam.interpreters.erlangR26; - beamPackagesPrev = pkgs.beam.packagesWith erlang; - elixir = beamPackagesPrev.elixir_1_15; - - beamPackages = beamPackagesPrev // rec { - inherit erlang elixir; - hex = beamPackagesPrev.hex.override { inherit elixir; }; - buildMix = beamPackagesPrev.buildMix.override { inherit elixir erlang hex; }; - mixRelease = beamPackagesPrev.mixRelease.override { inherit erlang elixir; }; - }; + erlang = pkgs.beam_minimal.interpreters.erlang_26; + beamPackages = pkgs.beam_minimal.packagesWith erlang; + elixir = beamPackages.elixir_1_16; inherit (pkgs.stdenv) isDarwin; inherit (gitignore.lib) gitignoreSource; @@ -75,11 +68,11 @@ check.enable = false; settings = { - excludes = [ "mix.nix" ]; + excludes = [ "deps.nix" ]; hooks = { deadnix.enable = true; - statix.enable = true; + #statix.enable = true; treefmt.enable = true; }; }; @@ -89,7 +82,7 @@ inherit pname version; src = gitignoreSource ./.; - mixNixDeps = import ./mix.nix { inherit lib beamPackages; }; + mixNixDeps = import ./deps.nix { inherit lib beamPackages; }; }; packages.container = pkgs.dockerTools.buildLayeredImage { @@ -120,7 +113,6 @@ ]); packages = [ - pkgs.mix2nix pkgs.mosquitto ]; diff --git a/lib/weewx_proxy/modbus/deye.ex b/lib/weewx_proxy/modbus/deye.ex new file mode 100644 index 0000000..0e4a59b --- /dev/null +++ b/lib/weewx_proxy/modbus/deye.ex @@ -0,0 +1,97 @@ +defmodule WeewxProxy.Modbus.Deye do + @moduledoc false + + require Logger + + use Tortoise311.Handler + + alias WeewxProxy.{Publisher, Utils} + + # Callbacks + + @impl true + def init(_opts) do + _ = Logger.info("Initializing handler") + {:ok, nil} + end + + @impl true + def connection(:up, state) do + _ = Logger.info("Connection has been established") + {:ok, state} + end + + @impl true + def connection(:down, state) do + _ = Logger.warning("Connection has been dropped") + {:ok, state} + end + + @impl true + def connection(:terminating, state) do + _ = Logger.warning("Connection is terminating") + {:ok, state} + end + + @impl true + def subscription(:up, topic, state) do + _ = Logger.info("Subscribed to `#{topic}'") + {:ok, state} + end + + @impl true + def subscription({:warn, [requested: req, accepted: qos]}, topic, state) do + _ = Logger.warning("Subscribed to `#{topic}'; requested #{req} but got accepted with QoS #{qos}") + {:ok, state} + end + + @impl true + def subscription({:error, reason}, topic, state) do + _ = Logger.error("Error subscribing to `#{topic}'; #{inspect(reason)}") + {:ok, state} + end + + @impl true + def subscription(:down, topic, state) do + _ = Logger.info("Unsubscribed from `#{topic}'") + {:ok, state} + end + + @impl true + def handle_message(topic, publish, state) do + full_topic = Enum.join(topic, "/") + parsed_message = parse_message(full_topic, publish) + + :ok = handle_reading(full_topic, parsed_message) + + {:ok, state} + end + + @impl true + def terminate(reason, _state) do + _ = Logger.warning("Client has been terminated with reason: `#{inspect(reason)}'") + :ok + end + + # Helper + + @spec parse_message(String.t(), String.t()) :: float() | nil + defp parse_message(topic, message) when topic in ["deye/day_energy", "deye/ac/active_power"] do + Utils.parse_float(message) + end + + defp parse_message(_topic, _message), do: nil + + @spec handle_reading(String.t(), float() | nil) :: :ok + defp handle_reading(_topic, nil), do: :ok + + defp handle_reading("deye/day_energy", reading) do + data = %{dateTime: Utils.utc_timestamp(), solarEnergyDay: reading} + Publisher.publish("weewx/ingest_si", data) + end + + defp handle_reading("deye/ac/active_power", reading) do + data = %{dateTime: Utils.utc_timestamp(), solarEnergyActive: reading} + Publisher.publish("weewx/ingest_si", data) + end +end diff --git a/lib/weewx_proxy/mqtt.ex b/lib/weewx_proxy/mqtt.ex index d930e79..1868ed6 100644 --- a/lib/weewx_proxy/mqtt.ex +++ b/lib/weewx_proxy/mqtt.ex @@ -40,16 +40,16 @@ defmodule WeewxProxy.Mqtt do ]}, {Tortoise311.Connection, [ - name: WeewxProxy.Mqtt.SdrIngest, - client_id: Application.fetch_env!(:weewx_proxy, :mqtt_sdr_client_id), + name: WeewxProxy.Mqtt.ModbusIngest, + client_id: Application.fetch_env!(:weewx_proxy, :mqtt_modbus_client_id), server: {Tortoise311.Transport.Tcp, - host: Application.fetch_env!(:weewx_proxy, :mqtt_sdr_host), - port: Application.fetch_env!(:weewx_proxy, :mqtt_sdr_port)}, - user_name: Application.fetch_env!(:weewx_proxy, :mqtt_sdr_user), - password: Application.fetch_env!(:weewx_proxy, :mqtt_sdr_password), - subscriptions: ["rtl433"], - handler: {WeewxProxy.Sdr.Ecowitt, []} + host: Application.fetch_env!(:weewx_proxy, :mqtt_modbus_host), + port: Application.fetch_env!(:weewx_proxy, :mqtt_modbus_port)}, + user_name: Application.fetch_env!(:weewx_proxy, :mqtt_modbus_user), + password: Application.fetch_env!(:weewx_proxy, :mqtt_modbus_password), + subscriptions: ["deye/#"], + handler: {WeewxProxy.Modbus.Deye, []} ]} ] diff --git a/mix.exs b/mix.exs index 8497584..40260aa 100644 --- a/mix.exs +++ b/mix.exs @@ -7,7 +7,11 @@ defmodule WeewxProxy.MixProject do version: "0.1.0", elixir: "~> 1.13", start_permanent: Mix.env() == :prod, - deps: deps() + deps: deps(), + aliases: [ + "deps.get": ["deps.get", "deps.nix"], + "deps.update": ["deps.update", "deps.nix"] + ] ] end @@ -22,14 +26,15 @@ defmodule WeewxProxy.MixProject do # Run "mix help deps" to learn about dependencies. defp deps do [ - {:plug_cowboy, "~> 2.6"}, + {:plug_cowboy, "~> 2.7"}, {:tortoise311, "~> 0.11"}, - {:httpoison, "~> 2.1"}, + {:httpoison, "~> 2.2"}, {:jason, "~> 1.4"}, {:tz, "~> 0.26"}, {:systemd, "~> 0.6"}, {:typed_struct, "~> 0.3.0", runtime: false}, - {:dialyxir, "~> 1.3", only: [:dev], runtime: false} + {:dialyxir, "~> 1.4", only: [:dev], runtime: false}, + {:deps_nix, "~> 0.5", only: :dev} ] end end diff --git a/mix.lock b/mix.lock index ef6afd8..950c6d2 100644 --- a/mix.lock +++ b/mix.lock @@ -1,29 +1,30 @@ %{ - "certifi": {:hex, :certifi, "2.9.0", "6f2a475689dd47f19fb74334859d460a2dc4e3252a3324bd2111b8f0429e7e21", [:rebar3], [], "hexpm", "266da46bdb06d6c6d35fde799bcb28d36d985d424ad7c08b5bb48f5b5cdd4641"}, - "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, + "certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"}, + "cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"}, "cowboy_telemetry": {:hex, :cowboy_telemetry, "0.4.0", "f239f68b588efa7707abce16a84d0d2acf3a0f50571f8bb7f56a15865aae820c", [:rebar3], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7d98bac1ee4565d31b62d59f8823dfd8356a169e7fcbb83831b8a5397404c9de"}, - "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, - "dialyxir": {:hex, :dialyxir, "1.3.0", "fd1672f0922b7648ff9ce7b1b26fcf0ef56dda964a459892ad15f6b4410b5284", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "00b2a4bcd6aa8db9dcb0b38c1225b7277dca9bc370b6438715667071a304696f"}, + "cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"}, + "deps_nix": {:hex, :deps_nix, "0.5.1", "fa970bb31a9454205e777af94661c629b1712d3ae1b1f76f815dfe2e35ece2bb", [:mix], [], "hexpm", "2b92b0a4b6c87f0a47fe1fe3bf102018cb9fa0be781c1e6f4feb380ea140b5e7"}, + "dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"}, "enough": {:hex, :enough, "0.1.0", "0254710c52d324e2dadde54cb56fbb80a792c2eb285669b8379efd0752bf89f0", [:rebar3], [], "hexpm", "0460c7abda5f5e0ea592b12bc6976b8a5c4b96e42f332059cd396525374bf9a1"}, - "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, + "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "gen_state_machine": {:hex, :gen_state_machine, "3.0.0", "1e57f86a494e5c6b14137ebef26a7eb342b3b0070c7135f2d6768ed3f6b6cdff", [:mix], [], "hexpm", "0a59652574bebceb7309f6b749d2a41b45fdeda8dbb4da0791e355dd19f0ed15"}, - "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~>2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, - "httpoison": {:hex, :httpoison, "2.1.0", "655fd9a7b0b95ee3e9a3b535cf7ac8e08ef5229bab187fa86ac4208b122d934b", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "fc455cb4306b43827def4f57299b2d5ac8ac331cb23f517e734a4b78210a160c"}, + "hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~>2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~>6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~>1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~>1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"}, + "httpoison": {:hex, :httpoison, "2.2.1", "87b7ed6d95db0389f7df02779644171d7319d319178f6680438167d7b69b1f3d", [:mix], [{:hackney, "~> 1.17", [hex: :hackney, repo: "hexpm", optional: false]}], "hexpm", "51364e6d2f429d80e14fe4b5f8e39719cacd03eb3f9a9286e61e216feac2d2df"}, "idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~>0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"}, - "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, + "jason": {:hex, :jason, "1.4.3", "d3f984eeb96fe53b85d20e0b049f03e57d075b5acda3ac8d465c969a2536c17b", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "9a90e868927f7c777689baa16d86f4d0e086d968db5c05d917ccff6d443e58a3"}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, - "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, - "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, - "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, - "plug": {:hex, :plug, "1.14.2", "cff7d4ec45b4ae176a227acd94a7ab536d9b37b942c8e8fa6dfc0fff98ff4d80", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "842fc50187e13cf4ac3b253d47d9474ed6c296a8732752835ce4a86acdf68d13"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.6.1", "9a3bbfceeb65eff5f39dab529e5cd79137ac36e913c02067dba3963a26efe9b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "de36e1a21f451a18b790f37765db198075c25875c64834bcc82d90b309eb6613"}, - "plug_crypto": {:hex, :plug_crypto, "1.2.5", "918772575e48e81e455818229bf719d4ab4181fcbf7f85b68a35620f78d89ced", [:mix], [], "hexpm", "26549a1d6345e2172eb1c233866756ae44a9609bd33ee6f99147ab3fd87fd842"}, + "mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"}, + "mimerl": {:hex, :mimerl, "1.3.0", "d0cd9fc04b9061f82490f6581e0128379830e78535e017f7780f37fea7545726", [:rebar3], [], "hexpm", "a1e15a50d1887217de95f0b9b0793e32853f7c258a5cd227650889b38839fe9d"}, + "parse_trans": {:hex, :parse_trans, "3.4.1", "6e6aa8167cb44cc8f39441d05193be6e6f4e7c2946cb2759f015f8c56b76e5ff", [:rebar3], [], "hexpm", "620a406ce75dada827b82e453c19cf06776be266f5a67cff34e1ef2cbb60e49a"}, + "plug": {:hex, :plug, "1.16.1", "40c74619c12f82736d2214557dedec2e9762029b2438d6d175c5074c933edc9d", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a13ff6b9006b03d7e33874945b2755253841b238c34071ed85b0e86057f8cddc"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.7.1", "87677ffe3b765bc96a89be7960f81703223fe2e21efa42c125fcd0127dd9d6b2", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "02dbd5f9ab571b864ae39418db7811618506256f6d13b4a45037e5fe78dc5de3"}, + "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "systemd": {:hex, :systemd, "0.6.2", "aaa24f1e3e6cb978c45369768b1abd766a0dbff637ed61254ca64797bcec9963", [:rebar3], [{:enough, "~>0.1.0", [hex: :enough, repo: "hexpm", optional: false]}], "hexpm", "5062b911800c1ab05157c7bf9a9fbe23dd24c58891c87fd12d2e3ed8fc1708b8"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "tortoise311": {:hex, :tortoise311, "0.11.7", "29e78e6ffa153a2c0728344277e587342cf7035ee62a38dc5656d970007920f0", [:mix], [{:gen_state_machine, "~> 2.0 or ~> 3.0", [hex: :gen_state_machine, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0ef7cf940b50ab47c433323294c9a3bb2883a03e0c7cb37de3e860c0b9ba5bef"}, "typed_struct": {:hex, :typed_struct, "0.3.0", "939789e3c1dca39d7170c87f729127469d1315dcf99fee8e152bb774b17e7ff7", [:mix], [], "hexpm", "c50bd5c3a61fe4e198a8504f939be3d3c85903b382bde4865579bc23111d1b6d"}, - "tz": {:hex, :tz, "0.26.2", "a40e4bb223344c6fc7b74dda25df1f26b88a30db23fa6e55de843bd79148ccdb", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: true]}], "hexpm", "224b0618dd1e032778a094040bc710ef9aff6e2fa8fffc2716299486f27b9e68"}, + "tz": {:hex, :tz, "0.26.5", "bfe8efa345670f90351c5c31d22455d0307c5d9895fbdede7deeb215a7b60dbe", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: true]}], "hexpm", "c4f9392d710582c7108b6b8c635f4981120ec4b2072adbd242290fc842338183"}, "unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"}, } diff --git a/mix.nix b/mix.nix deleted file mode 100644 index 179e09f..0000000 --- a/mix.nix +++ /dev/null @@ -1,364 +0,0 @@ -{ lib, beamPackages, overrides ? (x: y: { }) }: - -let - buildRebar3 = lib.makeOverridable beamPackages.buildRebar3; - buildMix = lib.makeOverridable beamPackages.buildMix; - buildErlangMk = lib.makeOverridable beamPackages.buildErlangMk; - - self = packages // (overrides self packages); - - packages = with beamPackages; with self; { - certifi = buildRebar3 rec { - name = "certifi"; - version = "2.9.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0ha6vmf5p3xlbf5w1msa89frhvfk535rnyfybz9wdmh6vdms8v96"; - }; - - beamDeps = [ ]; - }; - - cowboy = buildErlangMk rec { - name = "cowboy"; - version = "2.10.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0sqxqjdykxc2ai9cvkc0xjwkvr80z98wzlqlrd1z3iiw32vwrz9s"; - }; - - beamDeps = [ cowlib ranch ]; - }; - - cowboy_telemetry = buildRebar3 rec { - name = "cowboy_telemetry"; - version = "0.4.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1pn90is3k9dq64wbijvzkqb6ldfqvwiqi7ymc8dx6ra5xv0vm63x"; - }; - - beamDeps = [ cowboy telemetry ]; - }; - - cowlib = buildRebar3 rec { - name = "cowlib"; - version = "2.12.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1c4dgi8canscyjgddp22mjc69znvwy44wk3r7jrl2wvs6vv76fqn"; - }; - - beamDeps = [ ]; - }; - - dialyxir = buildMix rec { - name = "dialyxir"; - version = "1.3.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0vv90jip2w362n3l7dkhqfdwlz97nwji535kn3fbk3dassya9ch0"; - }; - - beamDeps = [ erlex ]; - }; - - enough = buildRebar3 rec { - name = "enough"; - version = "0.1.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "18gr9cvjar9rrmcj0crgwjb4np4adfbwcaxijajhwpjzvamwfq04"; - }; - - beamDeps = [ ]; - }; - - erlex = buildMix rec { - name = "erlex"; - version = "0.2.6"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0x8c1j62y748ldvlh46sxzv5514rpzm809vxn594vd7y25by5lif"; - }; - - beamDeps = [ ]; - }; - - gen_state_machine = buildMix rec { - name = "gen_state_machine"; - version = "3.0.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "05gdy0cxsmg3j43xmd6vm3nzsi8vlk94kdzn15rypg5yfhjnan8a"; - }; - - beamDeps = [ ]; - }; - - hackney = buildRebar3 rec { - name = "hackney"; - version = "1.18.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "13hja14kig5jnzcizpdghj68i88f0yd9wjdfjic9nzi98kzxmv54"; - }; - - beamDeps = [ certifi idna metrics mimerl parse_trans ssl_verify_fun unicode_util_compat ]; - }; - - httpoison = buildMix rec { - name = "httpoison"; - version = "2.1.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "030n18hphjsafdz52gxj3hrsrj2s5ndjjmsgxxyq4hvb62s5qigw"; - }; - - beamDeps = [ hackney ]; - }; - - idna = buildRebar3 rec { - name = "idna"; - version = "6.1.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1sjcjibl34sprpf1dgdmzfww24xlyy34lpj7mhcys4j4i6vnwdwj"; - }; - - beamDeps = [ unicode_util_compat ]; - }; - - jason = buildMix rec { - name = "jason"; - version = "1.4.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "18d70i31bz11nr6vgsjn5prvhkvwqbyf3xq22ck5cnsnzp6ixc7v"; - }; - - beamDeps = [ ]; - }; - - metrics = buildRebar3 rec { - name = "metrics"; - version = "1.0.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "05lz15piphyhvvm3d1ldjyw0zsrvz50d2m5f2q3s8x2gvkfrmc39"; - }; - - beamDeps = [ ]; - }; - - mime = buildMix rec { - name = "mime"; - version = "2.0.5"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0p50h0ki8ay5sraiqxiajgwy1829bvyagj65bj9wjny4cnin83fs"; - }; - - beamDeps = [ ]; - }; - - mimerl = buildRebar3 rec { - name = "mimerl"; - version = "1.2.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "08wkw73dy449n68ssrkz57gikfzqk3vfnf264s31jn5aa1b5hy7j"; - }; - - beamDeps = [ ]; - }; - - parse_trans = buildRebar3 rec { - name = "parse_trans"; - version = "3.3.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "12w8ai6b5s6b4hnvkav7hwxd846zdd74r32f84nkcmjzi1vrbk87"; - }; - - beamDeps = [ ]; - }; - - plug = buildMix rec { - name = "plug"; - version = "1.14.2"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "04wdyv6nma74bj1m49vkm2bc5mjf8zclfg957fng8g71hw0wabw4"; - }; - - beamDeps = [ mime plug_crypto telemetry ]; - }; - - plug_cowboy = buildMix rec { - name = "plug_cowboy"; - version = "2.6.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "04v6xc4v741dr2y38j66fmcc4xc037dnaxzkj2vih6j53yif2dny"; - }; - - beamDeps = [ cowboy cowboy_telemetry plug ]; - }; - - plug_crypto = buildMix rec { - name = "plug_crypto"; - version = "1.2.5"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0hnqgzc3zas7j7wycgnkkdhaji5farkqccy2n4p1gqj5ccfrlm16"; - }; - - beamDeps = [ ]; - }; - - ranch = buildRebar3 rec { - name = "ranch"; - version = "1.8.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1rfz5ld54pkd2w25jadyznia2vb7aw9bclck21fizargd39wzys9"; - }; - - beamDeps = [ ]; - }; - - ssl_verify_fun = buildRebar3 rec { - name = "ssl_verify_fun"; - version = "1.1.7"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1y37pj5q6gk1vrnwg1vraws9yihrv9g4133w2qq1sh1piw71jk7y"; - }; - - beamDeps = [ ]; - }; - - systemd = buildRebar3 rec { - name = "systemd"; - version = "0.6.2"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1f082zydhgif5p8pzj4ii32j9p93psgrmgy7ax8v06hch08vjqjh"; - }; - - beamDeps = [ enough ]; - }; - - telemetry = buildRebar3 rec { - name = "telemetry"; - version = "1.2.1"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1mgyx9zw92g6w8fp9pblm3b0bghwxwwcbslrixq23ipzisfwxnfs"; - }; - - beamDeps = [ ]; - }; - - tortoise311 = buildMix rec { - name = "tortoise311"; - version = "0.11.7"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "1vsvpaww0q78wdyv6z0c7sh86a5vlg4r8cij6g24gash1faczxqf"; - }; - - beamDeps = [ gen_state_machine telemetry ]; - }; - - typed_struct = buildMix rec { - name = "typed_struct"; - version = "0.3.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0v8v3l8j7g3ran3f9gc2nc1mkj6kwfdr6kshm2cf3r0zlv1xa2y5"; - }; - - beamDeps = [ ]; - }; - - tz = buildMix rec { - name = "tz"; - version = "0.26.2"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "0s4yggr8d5192qkzrzx85xpgz6pg233hn14ll1w2f0qyvlc0cjr2"; - }; - - beamDeps = [ ]; - }; - - unicode_util_compat = buildRebar3 rec { - name = "unicode_util_compat"; - version = "0.7.0"; - - src = fetchHex { - pkg = "${name}"; - version = "${version}"; - sha256 = "08952lw8cjdw8w171lv8wqbrxc4rcmb3jhkrdb7n06gngpbfdvi5"; - }; - - beamDeps = [ ]; - }; - }; -in -self -