git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #155216 from sudosubin/feature/pipenv-completions
commit84ccd32d19ae50fdeb2e3244ae845f2d9c8bcc52 authorlegendofmiracles <30902201+legendofmiracles@users.noreply.github.com> dateTue 18 Jan 2022, 11:52 (5 years ago) parentdef9731617f6e0
1 file changed+10
pkgs/development/tools/pipenv/default.nix+10
pkgs/development/tools/pipenv/default.nix+10
@@ -1,5 +1,6 @@
11{ lib
22, python3
3+, installShellFiles
34}:
45
56with python3.pkgs;
@@ -27,6 +28,8 @@ in buildPythonApplication rec {
2728
2829 LC_ALL = "en_US.UTF-8";
2930
31+ nativeBuildInputs = [ installShellFiles ];
32+
3033 postPatch = ''
3134 # pipenv invokes python in a subprocess to create a virtualenv
3235 # and to call setup.py.
@@ -38,6 +41,13 @@ in buildPythonApplication rec {
3841
3942 propagatedBuildInputs = runtimeDeps python3.pkgs;
4043
44+ postInstall = ''
45+ installShellCompletion --cmd pipenv \
46+ --bash <(_PIPENV_COMPLETE=bash_source $out/bin/pipenv) \
47+ --zsh <(_PIPENV_COMPLETE=zsh_source $out/bin/pipenv) \
48+ --fish <(_PIPENV_COMPLETE=fish_source $out/bin/pipenv)
49+ '';
50+
4151 doCheck = true;
4252 checkPhase = ''
4353 export HOME=$(mktemp -d)