mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 04:46:43 +00:00
01616e5331
Also make the attribute name to match the domain name. This is more in line with the home-assistant custom component ecosystem and allows additional validation between the derivation and the manifest. Also, at a later time, this will enable us to check for domain conflicts at eval time.
41 lines
746 B
Nix
41 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" ]
|
|
)
|