home-assistant-cli: install shell completions

This commit is contained in:
Robert Schütz 2019-02-06 14:42:59 +01:00
parent 874e0585e0
commit 78c73f7ec0

View File

@ -15,16 +15,28 @@ python36.pkgs.buildPythonApplication rec {
sed -i "s/'\(.*\)\(==\|>=\).*'/'\1'/g" setup.py
'';
nativeBuildInputs = [
glibcLocales
];
propagatedBuildInputs = with python36.pkgs; [
requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2 dateparser
];
LC_ALL = "en_US.UTF-8";
postInstall = ''
mkdir -p "$out/share/bash-completion/completions" "$out/share/zsh/site-functions"
$out/bin/hass-cli completion bash > "$out/share/bash-completion/completions/hass-cli"
$out/bin/hass-cli completion zsh > "$out/share/zsh/site-functions/_hass-cli"
'';
checkInputs = with python36.pkgs; [
pytest requests-mock glibcLocales
pytest requests-mock
];
checkPhase = ''
LC_ALL=en_US.UTF-8 pytest
pytest
'';
meta = with lib; {