From 40d5a353e8bcfb3c8d52a8379ad4c88a8c7bc045 Mon Sep 17 00:00:00 2001 From: teutat3s <10206665+teutat3s@users.noreply.github.com> Date: Mon, 16 Jun 2025 13:26:56 +0200 Subject: [PATCH] docker: use new completions The completions were taken from https://github.com/docker/cli/tree/master/contrib/completion Looking at recent PRs, it looks like these files are no longer being updated and instead everything is based on `docker completion`. This is consistent with the manual: https://github.com/docker/docs/blob/main/content/manuals/engine/cli/completion.md Co-authored-by: Tillmann Gaida --- .../virtualization/docker/default.nix | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index fd980618de81..715c42357eb9 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -315,6 +315,8 @@ rec { installPhase = '' + runHook preInstall + install -Dm755 ./build/docker $out/libexec/docker/docker makeWrapper $out/libexec/docker/docker $out/bin/docker \ @@ -330,11 +332,16 @@ rec { ln -s ${moby}/etc/systemd/system/docker.service $out/etc/systemd/system/docker.service ln -s ${moby}/etc/systemd/system/docker.socket $out/etc/systemd/system/docker.socket '' - + '' + # Required to avoid breaking cross builds + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' # completion (cli) - installShellCompletion --bash ./contrib/completion/bash/docker - installShellCompletion --fish ./contrib/completion/fish/docker.fish - installShellCompletion --zsh ./contrib/completion/zsh/_docker + installShellCompletion --cmd docker \ + --bash <($out/bin/docker completion bash) \ + --fish <($out/bin/docker completion fish) \ + --zsh <($out/bin/docker completion zsh) + '' + + '' + runHook postInstall ''; passthru = {