diff --git a/pkgs/development/python-modules/patool/default.nix b/pkgs/development/python-modules/patool/default.nix index b42c95661b57..8e868ce3ac2c 100644 --- a/pkgs/development/python-modules/patool/default.nix +++ b/pkgs/development/python-modules/patool/default.nix @@ -1,8 +1,10 @@ { + argcomplete, lib, stdenv, buildPythonPackage, fetchFromGitHub, + installShellFiles, pytestCheckHook, p7zip, cabextract, @@ -59,6 +61,17 @@ buildPythonPackage rec { --replace "path = None" 'path = os.environ["PATH"] + ":${lib.makeBinPath compression-utilities}"' ''; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd patool \ + --bash <(${argcomplete}/bin/register-python-argcomplete -s bash $out/bin/patool) \ + --fish <(${argcomplete}/bin/register-python-argcomplete -s fish $out/bin/patool) \ + --zsh <(${argcomplete}/bin/register-python-argcomplete -s zsh $out/bin/patool) + ''; + + nativeBuildInputs = [ + installShellFiles + ]; + nativeCheckInputs = [ pytestCheckHook ] ++ compression-utilities; disabledTests = [