mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-01 18:44:07 +00:00
31e60c2fbb
Builder to package up custom components for Home Assistant. These packages use `buildPythonPackage` with `format = "other"` and rely on a custom install phase, that expects a standardized path, and a custom check phase, that for now verifies python dependencies have been satisified. Co-Authored-By: Martin Weinelt <hexa@darmstadt.ccc.de> Co-Authored-By: Sandro Jäckel <sandro.jaeckel@gmail.com>
39 lines
706 B
Nix
39 lines
706 B
Nix
{ lib
|
|
, home-assistant
|
|
, makeSetupHook
|
|
}:
|
|
|
|
{ pname
|
|
, version
|
|
, format ? "other"
|
|
, ...
|
|
}@args:
|
|
|
|
let
|
|
manifestRequirementsCheckHook = import ./manifest-requirements-check-hook.nix {
|
|
inherit makeSetupHook;
|
|
inherit (home-assistant) python;
|
|
};
|
|
in
|
|
home-assistant.python.pkgs.buildPythonPackage (
|
|
{
|
|
inherit format;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir $out
|
|
cp -r $src/custom_components/ $out/
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
nativeCheckInputs = with home-assistant.python.pkgs; [
|
|
importlib-metadata
|
|
manifestRequirementsCheckHook
|
|
packaging
|
|
] ++ (args.nativeCheckInputs or []);
|
|
|
|
} // builtins.removeAttrs args [ "nativeCheckInputs" ]
|
|
)
|