From fb49094c3f3d3f37aaf4c882b1ee7b8790ccbf3b Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 00:23:49 +0200 Subject: [PATCH 1/2] nixos/home-assistant: NixOS is an unsupported installation method Trying to steer NixOS users away from reporting bugs to the upstream, when they don't have the capacity to support bugs that could be the result of our downstreaming setup. --- nixos/modules/services/misc/home-assistant.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/home-assistant.nix b/nixos/modules/services/misc/home-assistant.nix index 1e33381de24c..c8ffead7b1ac 100644 --- a/nixos/modules/services/misc/home-assistant.nix +++ b/nixos/modules/services/misc/home-assistant.nix @@ -66,7 +66,9 @@ in { meta.maintainers = teams.home-assistant.members; options.services.home-assistant = { - enable = mkEnableOption "Home Assistant"; + # Running home-assistant on NixOS is considered an installation method that is unsupported by the upstream project. + # https://github.com/home-assistant/architecture/blob/master/adr/0012-define-supported-installation-method.md#decision + enable = mkEnableOption "Home Assistant. Please note that this installation method is unsupported upstream"; configDir = mkOption { default = "/var/lib/hass"; From 0ba779b869a81bab1e4bf98d98c2bd45cc0062b9 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Tue, 15 Jun 2021 15:28:31 +0200 Subject: [PATCH 2/2] home-assistant: evaluate outdated dependencies based on our package set Home Assistant overwrites a bunch of dependencies resulting in an overridden python package set. Expose that via passthru as `home-assistant.python.pkgs` and use that in parse-requirements.py, so we take overridden versions into consideration. --- .../home-assistant/component-packages.nix | 20 +++++++++---------- pkgs/servers/home-assistant/default.nix | 6 +++--- .../home-assistant/parse-requirements.py | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index e76fe501a523..16dae600778a 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -157,7 +157,7 @@ "deconz" = ps: with ps; [ pydeconz ]; "decora" = ps: with ps; [ bluepy ]; # missing inputs: decora "decora_wifi" = ps: with ps; [ ]; # missing inputs: decora_wifi - "default_config" = ps: with ps; [ pynacl aiodiscover aiohttp-cors async-upnp-client defusedxml distro emoji hass-nabucasa ifaddr netdisco pillow scapy sqlalchemy zeroconf ]; + "default_config" = ps: with ps; [ pynacl aiodiscover aiohttp-cors async-upnp-client defusedxml distro emoji hass-nabucasa home-assistant-frontend ifaddr netdisco pillow scapy sqlalchemy zeroconf ]; "delijn" = ps: with ps; [ pydelijn ]; "deluge" = ps: with ps; [ deluge-client ]; "demo" = ps: with ps; [ aiohttp-cors ]; @@ -288,7 +288,7 @@ "fritzbox_callmonitor" = ps: with ps; [ fritzconnection ]; "fritzbox_netmonitor" = ps: with ps; [ fritzconnection ]; "fronius" = ps: with ps; [ ]; # missing inputs: pyfronius - "frontend" = ps: with ps; [ aiohttp-cors pillow ]; + "frontend" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; "frontier_silicon" = ps: with ps; [ ]; # missing inputs: afsapi "futurenow" = ps: with ps; [ pyfnip ]; "garadget" = ps: with ps; [ ]; @@ -339,7 +339,7 @@ "hangouts" = ps: with ps; [ ]; # missing inputs: hangups "harman_kardon_avr" = ps: with ps; [ ]; # missing inputs: hkavr "harmony" = ps: with ps; [ aioharmony ]; - "hassio" = ps: with ps; [ aiohttp-cors pillow ]; + "hassio" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; "haveibeenpwned" = ps: with ps; [ ]; "hddtemp" = ps: with ps; [ ]; "hdmi_cec" = ps: with ps; [ pycec ]; @@ -460,7 +460,7 @@ "local_ip" = ps: with ps; [ ]; "locative" = ps: with ps; [ aiohttp-cors ]; "lock" = ps: with ps; [ ]; - "logbook" = ps: with ps; [ aiohttp-cors pillow sqlalchemy ]; + "logbook" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow sqlalchemy ]; "logentries" = ps: with ps; [ ]; "logger" = ps: with ps; [ ]; "logi_circle" = ps: with ps; [ aiohttp-cors ha-ffmpeg ]; # missing inputs: logi_circle @@ -481,7 +481,7 @@ "mailgun" = ps: with ps; [ aiohttp-cors ]; # missing inputs: pymailgunner "manual" = ps: with ps; [ ]; "manual_mqtt" = ps: with ps; [ aiohttp-cors paho-mqtt ]; - "map" = ps: with ps; [ aiohttp-cors pillow ]; + "map" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; "marytts" = ps: with ps; [ ]; # missing inputs: speak2mary "mastodon" = ps: with ps; [ mastodon-py ]; "matrix" = ps: with ps; [ matrix-client ]; @@ -536,7 +536,7 @@ "mullvad" = ps: with ps; [ mullvad-api ]; "mutesync" = ps: with ps; [ mutesync ]; "mvglive" = ps: with ps; [ PyMVGLive ]; - "my" = ps: with ps; [ aiohttp-cors pillow ]; + "my" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; "mychevy" = ps: with ps; [ ]; # missing inputs: mychevy "mycroft" = ps: with ps; [ ]; # missing inputs: mycroftapi "myq" = ps: with ps; [ pymyq ]; @@ -592,7 +592,7 @@ "ohmconnect" = ps: with ps; [ defusedxml ]; "ombi" = ps: with ps; [ ]; # missing inputs: pyombi "omnilogic" = ps: with ps; [ omnilogic ]; - "onboarding" = ps: with ps; [ aiohttp-cors pillow ]; + "onboarding" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; "ondilo_ico" = ps: with ps; [ aiohttp-cors ondilo ]; "onewire" = ps: with ps; [ ]; # missing inputs: pi1wire pyownet "onkyo" = ps: with ps; [ onkyo-eiscp ]; @@ -624,8 +624,8 @@ "panasonic_bluray" = ps: with ps; [ ]; # missing inputs: panacotta "panasonic_viera" = ps: with ps; [ ]; # missing inputs: panasonic_viera "pandora" = ps: with ps; [ pexpect ]; - "panel_custom" = ps: with ps; [ aiohttp-cors pillow ]; - "panel_iframe" = ps: with ps; [ aiohttp-cors pillow ]; + "panel_custom" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; + "panel_iframe" = ps: with ps; [ aiohttp-cors home-assistant-frontend pillow ]; "pcal9535a" = ps: with ps; [ ]; # missing inputs: pcal9535a "pencom" = ps: with ps; [ ]; # missing inputs: pencompy "persistent_notification" = ps: with ps; [ ]; @@ -720,7 +720,7 @@ "russound_rio" = ps: with ps; [ ]; # missing inputs: russound_rio "russound_rnet" = ps: with ps; [ ]; # missing inputs: russound "sabnzbd" = ps: with ps; [ aiohttp-cors ifaddr netdisco zeroconf ]; # missing inputs: pysabnzbd - "safe_mode" = ps: with ps; [ aiohttp-cors hass-nabucasa pillow ]; + "safe_mode" = ps: with ps; [ aiohttp-cors hass-nabucasa home-assistant-frontend pillow ]; "saj" = ps: with ps; [ ]; # missing inputs: pysaj "samsungtv" = ps: with ps; [ samsungctl samsungtvws wakeonlan ]; "satel_integra" = ps: with ps; [ ]; # missing inputs: satel_integra diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index c2eae3756588..8de9fd8dde34 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -148,9 +148,9 @@ let }); }) - # hass-frontend does not exist in python3.pkgs + # home-assistant-frontend does not exist in python3.pkgs (self: super: { - hass-frontend = self.callPackage ./frontend.nix { }; + home-assistant-frontend = self.callPackage ./frontend.nix { }; }) ]; @@ -229,7 +229,6 @@ in with py.pkgs; buildPythonApplication rec { certifi ciso8601 cryptography - hass-frontend httpx jinja2 pip @@ -799,6 +798,7 @@ in with py.pkgs; buildPythonApplication rec { tests = { inherit (nixosTests) home-assistant; }; + python = py; }; meta = with lib; { diff --git a/pkgs/servers/home-assistant/parse-requirements.py b/pkgs/servers/home-assistant/parse-requirements.py index 27de7a60f370..5d8678a6267f 100755 --- a/pkgs/servers/home-assistant/parse-requirements.py +++ b/pkgs/servers/home-assistant/parse-requirements.py @@ -32,7 +32,7 @@ from rich.console import Console from rich.table import Table COMPONENT_PREFIX = "homeassistant.components" -PKG_SET = "python3Packages" +PKG_SET = "home-assistant.python.pkgs" # If some requirements are matched by multiple Python packages, # the following can be used to choose one of them