2c76a4cb41
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
38 lines
706 B
Nix
38 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" ]
|
|
)
|