Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
73 lines
1.3 KiB
Nix
73 lines
1.3 KiB
Nix
{
|
|
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 version format;
|
|
|
|
buildPhase = ''
|
|
true
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir $out
|
|
if [[ -f ./manifest.json ]]; then
|
|
mkdir $out/custom_components
|
|
cp -R "$(realpath .)" "$out/custom_components/${domain}"
|
|
else
|
|
cp -r ./custom_components/ $out/
|
|
fi
|
|
|
|
# optionally copy sentences, if they exist
|
|
if [[ -d ./custom_sentences ]]; then
|
|
cp -r ./custom_sentences/ $out/
|
|
fi
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
nativeCheckInputs =
|
|
with home-assistant.python.pkgs;
|
|
[
|
|
manifestRequirementsCheckHook
|
|
packaging
|
|
]
|
|
++ (args.nativeCheckInputs or [ ]);
|
|
|
|
passthru = {
|
|
isHomeAssistantComponent = true;
|
|
}
|
|
// args.passthru or { };
|
|
|
|
meta = {
|
|
inherit (home-assistant.meta) platforms;
|
|
}
|
|
// args.meta or { };
|
|
|
|
}
|
|
// removeAttrs args [
|
|
"meta"
|
|
"nativeCheckInputs"
|
|
"passthru"
|
|
]
|
|
)
|