Merge pull request #210310 from mweinelt/home-assistant-intents
home-assistant.intents: init at 2023.1.25
This commit is contained in:
commit
972094a0d6
@ -297,8 +297,9 @@ let
|
||||
};
|
||||
});
|
||||
|
||||
# home-assistant-frontend does not exist in python3.pkgs
|
||||
# internal python packages only consumed by home-assistant itself
|
||||
home-assistant-frontend = self.callPackage ./frontend.nix { };
|
||||
home-assistant-intents = self.callPackage ./intents.nix { };
|
||||
})
|
||||
];
|
||||
|
||||
@ -496,6 +497,7 @@ in python.pkgs.buildPythonApplication rec {
|
||||
getPackages
|
||||
python
|
||||
supportedComponentsWithTests;
|
||||
intents = python.pkgs.home-assistant-intents;
|
||||
tests = {
|
||||
nixos = nixosTests.home-assistant;
|
||||
components = callPackage ./tests.nix { };
|
||||
|
67
pkgs/servers/home-assistant/intents.nix
Normal file
67
pkgs/servers/home-assistant/intents.nix
Normal file
@ -0,0 +1,67 @@
|
||||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pythonOlder
|
||||
, setuptools
|
||||
|
||||
# build
|
||||
, hassil
|
||||
, jinja2
|
||||
, pyyaml
|
||||
, regex
|
||||
, voluptuous
|
||||
, python
|
||||
|
||||
# tests
|
||||
, pytest-xdist
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "home-assistant-intents";
|
||||
version = "2023.1.25";
|
||||
format = "pyproject";
|
||||
|
||||
disabled = pythonOlder "3.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "home-assistant";
|
||||
repo = "intents";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-nMEcN2b0XHF4yRRsHKMplxqcMLl+gJcPAdvwnySN+ug=";
|
||||
};
|
||||
|
||||
sourceRoot = "source/package";
|
||||
|
||||
nativeBuildInputs = [
|
||||
hassil
|
||||
jinja2
|
||||
pyyaml
|
||||
regex
|
||||
setuptools
|
||||
voluptuous
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
pushd ..
|
||||
# https://github.com/home-assistant/intents/blob/main/script/package#L18
|
||||
${python.interpreter} -m script.intentfest merged_output $out/${python.sitePackages}/home-assistant-intents/home_assistant_intents/data
|
||||
popd
|
||||
'';
|
||||
|
||||
checkInputs = [
|
||||
pytest-xdist
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pytestFlagsArray = [
|
||||
"../tests"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Intents to be used with Home Assistant";
|
||||
homepage = "https://github.com/home-assistant/intents";
|
||||
license = licenses.cc-by-40;
|
||||
maintainers = teams.home-assistant.members;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user