home-assistant: expose installed extraPackages and extraComponents

Useful data provided for the NixOS test.
This commit is contained in:
Martin Weinelt 2022-02-14 01:48:09 +01:00
parent c1d2042219
commit 3f8ddef902
No known key found for this signature in database
GPG key ID: 87C1E9888F856759

View file

@ -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";
@ -283,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