mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
apx: install shell completions
This commit is contained in:
parent
a35fac798e
commit
45087e1666
@ -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; {
|
||||
|
Loading…
Reference in New Issue
Block a user