nixos/virtualisation/podman: add shell completions for podman dockerCompat
This can fix shell completion for `podman.dockerCompat`.
This commit is contained in:
@@ -10,11 +10,13 @@ let
|
||||
json = pkgs.formats.json { };
|
||||
|
||||
inherit (lib) mkOption types;
|
||||
inherit (pkgs) stdenv;
|
||||
|
||||
# Provides a fake "docker" binary mapping to podman
|
||||
dockerCompat =
|
||||
pkgs.runCommand "${cfg.package.pname}-docker-compat-${cfg.package.version}"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.installShellFiles ];
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
@@ -31,7 +33,14 @@ let
|
||||
basename=$(basename $f | sed s/podman/docker/g)
|
||||
ln -s $f $man/share/man/man1/$basename
|
||||
done
|
||||
'';
|
||||
''
|
||||
+ lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
export HOME=$(mktemp -d) # work around `docker <cmd>`
|
||||
installShellCompletion --cmd docker \
|
||||
--bash <($out/bin/docker completion bash) \
|
||||
--zsh <($out/bin/docker completion zsh) \
|
||||
--fish <($out/bin/docker completion fish)
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user