2023-11-16 04:20:00 +00:00
|
|
|
{ lib
|
|
|
|
, home-assistant
|
|
|
|
, makeSetupHook
|
|
|
|
}:
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
{ owner
|
|
|
|
, domain
|
2023-11-16 04:20:00 +00:00
|
|
|
, version
|
|
|
|
, format ? "other"
|
|
|
|
, ...
|
|
|
|
}@args:
|
|
|
|
|
|
|
|
let
|
|
|
|
manifestRequirementsCheckHook = import ./manifest-requirements-check-hook.nix {
|
|
|
|
inherit makeSetupHook;
|
|
|
|
inherit (home-assistant) python;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
home-assistant.python.pkgs.buildPythonPackage (
|
|
|
|
{
|
2024-01-02 11:29:13 +00:00
|
|
|
pname = "${owner}/${domain}";
|
2023-11-16 04:20:00 +00:00
|
|
|
inherit format;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir $out
|
2024-01-02 11:29:13 +00:00
|
|
|
cp -r ./custom_components/ $out/
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeCheckInputs = with home-assistant.python.pkgs; [
|
|
|
|
importlib-metadata
|
|
|
|
manifestRequirementsCheckHook
|
|
|
|
packaging
|
|
|
|
] ++ (args.nativeCheckInputs or []);
|
|
|
|
|
|
|
|
} // builtins.removeAttrs args [ "nativeCheckInputs" ]
|
|
|
|
)
|