diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 38604c3516be..59ace4cff11a 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -354,6 +354,7 @@ let }); # internal python packages only consumed by home-assistant itself + hass-web-proxy-lib = self.callPackage ./python-modules/hass-web-proxy-lib { }; home-assistant-frontend = self.callPackage ./frontend.nix { }; home-assistant-intents = self.callPackage ./intents.nix { }; homeassistant = self.toPythonModule home-assistant; diff --git a/pkgs/servers/home-assistant/python-modules/hass-web-proxy-lib/default.nix b/pkgs/servers/home-assistant/python-modules/hass-web-proxy-lib/default.nix new file mode 100644 index 000000000000..0cb298e48d68 --- /dev/null +++ b/pkgs/servers/home-assistant/python-modules/hass-web-proxy-lib/default.nix @@ -0,0 +1,72 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + fetchpatch2, + + # build-system + poetry-core, + + # dependencies + aiohttp, + + # tests + home-assistant, + pytest-aiohttp, + pytest-cov-stub, + pytest-homeassistant-custom-component, + pytest-timeout, + pytestCheckHook, + + # reverse dependencies + home-assistant-custom-components, +}: + +buildPythonPackage rec { + pname = "hass-web-proxy-lib"; + version = "0.0.7"; + pyproject = true; + + # no tags on git + src = fetchPypi { + pname = "hass_web_proxy_lib"; + inherit version; + hash = "sha256-bhz71tNOpZ+4tSlndS+UbC3w2WW5+dAMtpk7TnnFpuQ="; + }; + + patches = [ + (fetchpatch2 { + name = "add-missing-build-system.patch"; + url = "https://github.com/dermotduffy/hass-web-proxy-lib/commit/0eed7a57f503fc552948a45e7f490ddaff711896.patch"; + hash = "sha256-ccOdhA0NhlTmdA51sNdB357Xh13E4PsLlvUTU4GQ9jk="; + }) + ]; + + build-system = [ poetry-core ]; + + dependencies = [ aiohttp ]; + + nativeCheckInputs = [ + home-assistant + pytest-aiohttp + pytest-cov-stub + pytest-homeassistant-custom-component + pytest-timeout + pytestCheckHook + ]; + + pythonImportsCheck = [ + "hass_web_proxy_lib" + ]; + + passthru.tests = { + inherit (home-assistant-custom-components) frigate; + }; + + meta = { + description = "A library to proxy web traffic through Home Assistant integrations"; + homepage = "https://github.com/dermotduffy/hass-web-proxy-lib"; + license = lib.licenses.mit; + maintainers = home-assistant-custom-components.frigate.meta.maintainers; + }; +}