about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/home-assistant/default.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-10 07:13:44 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-12 14:07:16 +0000
commite2698550456abba83c6dcd5d5e5a9990a0b96f8a (patch)
tree79a56f0df3fa55e470d84b4dff6059fbf487ec18 /nixpkgs/pkgs/servers/home-assistant/default.nix
parent1cdc42df888dc98c347e03bd942ed9825a55bcb3 (diff)
parent84d74ae9c9cbed73274b8e4e00be14688ffc93fe (diff)
downloadnixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.gz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.bz2
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.lz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.xz
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.tar.zst
nixlib-e2698550456abba83c6dcd5d5e5a9990a0b96f8a.zip
Merge commit '84d74ae9c9cbed73274b8e4e00be14688ffc93fe'
Diffstat (limited to 'nixpkgs/pkgs/servers/home-assistant/default.nix')
-rw-r--r--nixpkgs/pkgs/servers/home-assistant/default.nix46
1 files changed, 30 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/servers/home-assistant/default.nix b/nixpkgs/pkgs/servers/home-assistant/default.nix
index 33fbbf663102..17ce095e3938 100644
--- a/nixpkgs/pkgs/servers/home-assistant/default.nix
+++ b/nixpkgs/pkgs/servers/home-assistant/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchFromGitHub, fetchpatch, python3, protobuf3_6
+{ stdenv, nixosTests, lib, fetchurl, fetchFromGitHub, fetchpatch, python3, protobuf3_6
 
 # Look up dependencies of specified components in component-packages.nix
 , extraComponents ? [ ]
@@ -22,17 +22,18 @@ let
   defaultOverrides = [
     # Override the version of some packages pinned in Home Assistant's setup.py
 
-    # used by check_config script
-    # can be unpinned once https://github.com/home-assistant/home-assistant/issues/11917 is resolved
-    (mkOverride "colorlog" "4.0.2"
-      "3cf31b25cbc8f86ec01fef582ef3b840950dea414084ed19ab922c8b493f9b42")
+    # required by the sun/moon plugins
+    # https://github.com/home-assistant/core/issues/36636
+    (mkOverride "astral" "1.10.1"
+      "d2a67243c4503131c856cafb1b1276de52a86e5b8a1d507b7e08bee51cb67bf1")
 
-    # required by aioesphomeapi
-    (self: super: {
-      protobuf = super.protobuf.override {
-        protobuf = protobuf3_6;
-      };
-    })
+    # We have 3.x in nixpkgs which is incompatible with home-assistant atm:
+    # https://github.com/home-assistant/core/blob/dev/requirements_all.txt
+    (mkOverride "pyowm" "2.10.0"
+      "1xvcv3sbcn9na8cwz21nnjlixysfk5lymnf65d1nqkbgacc1mm4g")
+
+    (mkOverride "bcrypt" "3.1.7"
+      "0hhywhxx301cxivgxrpslrangbfpccc8y83qbwn1f57cab3nj00b")
 
     # hass-frontend does not exist in python3.pkgs
     (self: super: {
@@ -67,7 +68,7 @@ let
   extraBuildInputs = extraPackages py.pkgs;
 
   # Don't forget to run parse-requirements.py after updating
-  hassVersion = "0.111.0";
+  hassVersion = "0.114.4";
 
 in with py.pkgs; buildPythonApplication rec {
   pname = "homeassistant";
@@ -76,7 +77,7 @@ in with py.pkgs; buildPythonApplication rec {
   disabled = pythonOlder "3.5";
 
   patches = [
-    ./0001-setup.py-relax-dependencies.patch
+    ./relax-dependencies.patch
   ];
 
   inherit availableComponents;
@@ -86,9 +87,14 @@ in with py.pkgs; buildPythonApplication rec {
     owner = "home-assistant";
     repo = "core";
     rev = version;
-    sha256 = "0zg7fng3cfksn4hr8vixsmj8cbag8h4dg4qi69n56hc71rnpl9kw";
+    sha256 = "0k9px4ny0b72d9ysr3x72idprgfgjab1z91ildr87629826bb4n7";
   };
 
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "yarl==1.4.2" "yarl~=1.4"
+  '';
+
   propagatedBuildInputs = [
     # From setup.py
     aiohttp astral async-timeout attrs bcrypt certifi importlib-metadata jinja2
@@ -109,9 +115,14 @@ in with py.pkgs; buildPythonApplication rec {
     # - components' dependencies are not included, so they cannot be tested
     # - test_merge_id_schema requires pyqwikswitch
     # - test_loader.py tries to load not-packaged dependencies
+    # - test_notify pyotp doesn't like the short mock keys
     # - unclear why test_merge fails: assert merge_log_err.call_count != 0
     # - test_setup_safe_mode_if_no_frontend: requires dependencies for components we have not packaged
-    py.test --ignore tests/components --ignore tests/test_loader.py -k "not test_setup_safe_mode_if_no_frontend and not test_merge_id_schema and not test_merge"
+    py.test \
+      --ignore tests/components \
+      --ignore tests/test_loader.py \
+      --ignore tests/auth/mfa_modules/test_notify.py \
+      -k "not test_setup_safe_mode_if_no_frontend and not test_merge_id_schema and not test_merge"
 
     # Some basic components should be tested however
     py.test \
@@ -123,12 +134,15 @@ in with py.pkgs; buildPythonApplication rec {
 
   passthru = {
     inherit (py.pkgs) hass-frontend;
+    tests = {
+      inherit (nixosTests) home-assistant;
+    };
   };
 
   meta = with lib; {
     homepage = "https://home-assistant.io/";
     description = "Open-source home automation platform running on Python 3";
     license = licenses.asl20;
-    maintainers = with maintainers; [ dotlambda globin mic92 ];
+    maintainers = with maintainers; [ dotlambda globin mic92 hexa ];
   };
 }