summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
authorRobert Schütz <robert.schuetz@stud.uni-heidelberg.de>2019-02-06 14:42:59 +0100
committerRobert Schütz <robert.schuetz@stud.uni-heidelberg.de>2019-02-06 14:42:59 +0100
commit78c73f7ec036b01830dec84abf3c71725c069faf (patch)
tree415a6c1549ac9bef028075b5e53223aba6f9722b /pkgs/servers
parent874e0585e0415e086487bf8beabd6707731c30cc (diff)
downloadnixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.tar
nixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.tar.gz
nixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.tar.bz2
nixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.tar.lz
nixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.tar.xz
nixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.tar.zst
nixpkgs-78c73f7ec036b01830dec84abf3c71725c069faf.zip
home-assistant-cli: install shell completions
Diffstat (limited to 'pkgs/servers')
-rw-r--r--pkgs/servers/home-assistant/cli.nix16
1 files changed, 14 insertions, 2 deletions
diff --git a/pkgs/servers/home-assistant/cli.nix b/pkgs/servers/home-assistant/cli.nix
index fff804d53a1..90e4b0c736d 100644
--- a/pkgs/servers/home-assistant/cli.nix
+++ b/pkgs/servers/home-assistant/cli.nix
@@ -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; {