about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2022-02-16 00:40:22 +0100
committerGitHub <noreply@github.com>2022-02-16 00:40:22 +0100
commite43b87552d411864d840204d2ad7685364ba7852 (patch)
treecbf279ed862f4f8d05ca17e0b9d303eedc317246 /pkgs
parent9dee6cdb29175f464d640984eaf15017926072b0 (diff)
parent32bd0aafab0076ef09a3f256f61240c05daa0f4d (diff)
Merge pull request #157213 from mweinelt/hass-module
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/servers/home-assistant/default.nix13
-rw-r--r--pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch27
2 files changed, 12 insertions, 28 deletions
diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix
index 3d446f1f2749b..b000431fd1c7c 100644
--- a/pkgs/servers/home-assistant/default.nix
+++ b/pkgs/servers/home-assistant/default.nix
@@ -15,6 +15,9 @@
 # Additional packages to add to propagatedBuildInputs
 , extraPackages ? ps: []
 
+# Write out info about included extraComponents and extraPackages
+, writeText
+
 # Override Python packages using
 # self: super: { pkg = super.pkg.overridePythonAttrs (oldAttrs: { ... }); }
 # Applied after defaultOverrides
@@ -130,6 +133,10 @@ let
   # Ensure that we are using a consistent package set
   extraBuildInputs = extraPackages python.pkgs;
 
+  # Create info about included packages and components
+  extraComponentsFile = writeText "home-assistant-components" (lib.concatStringsSep "\n" extraComponents);
+  extraPackagesFile = writeText "home-assistant-packages" (lib.concatMapStringsSep "\n" (pkg: pkg.pname) extraBuildInputs);
+
   # Don't forget to run parse-requirements.py after updating
   hassVersion = "2022.2.6";
 
@@ -158,7 +165,6 @@ in python.pkgs.buildPythonApplication rec {
       src = ./patches/ffmpeg-path.patch;
       ffmpeg = "${lib.getBin ffmpeg}/bin/ffmpeg";
     })
-    ./patches/tests-ignore-OSErrors-in-hass-fixture.patch
   ];
 
   postPatch = let
@@ -284,6 +290,11 @@ in python.pkgs.buildPythonApplication rec {
     export PATH=${inetutils}/bin:$PATH
   '';
 
+  postInstall = ''
+    cp -v ${extraComponentsFile} $out/extra_components
+    cp -v ${extraPackagesFile} $out/extra_packages
+  '';
+
   passthru = {
     inherit
       availableComponents
diff --git a/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch b/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch
deleted file mode 100644
index add0ea1d5521f..0000000000000
--- a/pkgs/servers/home-assistant/patches/tests-ignore-OSErrors-in-hass-fixture.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 3e3f5c37252a33ea1e71c39f2ca0f13940c261ad Mon Sep 17 00:00:00 2001
-From: Martin Weinelt <hexa@darmstadt.ccc.de>
-Date: Sat, 17 Jul 2021 16:11:23 +0200
-Subject: [PATCH] tests: ignore OSErrors in hass fixture
-
-The nix sandbox will cause OSErrors due to limitations imposed on
-network interaction. This change makes it so we forgive these cases.
----
- tests/conftest.py | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/tests/conftest.py b/tests/conftest.py
-index 1f5ffc80d0..b284727a0f 100644
---- a/tests/conftest.py
-+++ b/tests/conftest.py
-@@ -168,6 +168,8 @@ def hass(loop, load_registries, hass_storage, request):
-             continue
-         if isinstance(ex, ServiceNotFound):
-             continue
-+        if isinstance(ex, OSError):
-+            continue
-         raise ex
- 
- 
--- 
-2.32.0
-