504525a148
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
40 lines
746 B
Nix
40 lines
746 B
Nix
{ lib
|
|
, home-assistant
|
|
, makeSetupHook
|
|
}:
|
|
|
|
{ owner
|
|
, domain
|
|
, version
|
|
, format ? "other"
|
|
, ...
|
|
}@args:
|
|
|
|
let
|
|
manifestRequirementsCheckHook = import ./manifest-requirements-check-hook.nix {
|
|
inherit makeSetupHook;
|
|
inherit (home-assistant) python;
|
|
};
|
|
in
|
|
home-assistant.python.pkgs.buildPythonPackage (
|
|
{
|
|
pname = "${owner}/${domain}";
|
|
inherit format;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir $out
|
|
cp -r ./custom_components/ $out/
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
nativeCheckInputs = with home-assistant.python.pkgs; [
|
|
importlib-metadata
|
|
manifestRequirementsCheckHook
|
|
packaging
|
|
] ++ (args.nativeCheckInputs or []);
|
|
|
|
} // builtins.removeAttrs args [ "nativeCheckInputs" ]
|
|
)
|