diff --git a/pkgs/tools/package-management/apx/default.nix b/pkgs/tools/package-management/apx/default.nix index 89f7b6032aee..381307d6735e 100644 --- a/pkgs/tools/package-management/apx/default.nix +++ b/pkgs/tools/package-management/apx/default.nix @@ -4,6 +4,7 @@ fetchFromGitHub, installShellFiles, distrobox, + podman, }: buildGoModule rec { @@ -19,7 +20,8 @@ buildGoModule rec { vendorHash = "sha256-hGi+M5RRUL2oyxFGVeR0sum93/CA+FGYy0m4vDmlXTc="; - nativeBuildInputs = [ installShellFiles ]; + # podman needed for apx to not error when building shell completions + nativeBuildInputs = [ installShellFiles podman ]; ldflags = [ "-s" "-w" ]; @@ -36,6 +38,15 @@ buildGoModule rec { installManPage man/man1/* install -Dm444 README.md -t $out/share/docs/apx install -Dm444 COPYING.md $out/share/licenses/apx/LICENSE + + # Create a temp writable home-dir so apx outputs completions without error + export HOME=$(mktemp -d) + # apx command now works (for completions) + # though complains "Error: no such file or directory" + installShellCompletion --cmd apx \ + --bash <($out/bin/apx completion bash) \ + --fish <($out/bin/apx completion fish) \ + --zsh <($out/bin/apx completion zsh) ''; meta = with lib; {