# ── dock : rootless Docker wrapper (NixOS) ───────────────────────────────────# Aliases and completion for ~/.local/bin/dock. Safe to delete this file and# the matching >>> dock >>> block in ~/.dotfiles/.zshrc to remove it entirely.## No PATH handling here: NixOS puts ~/.local/bin first on PATH itself# (environment.localBinInPath, modules/hosts/laptop/toolbox.nix).## Everything here is defensive: a missing binary or a broken completion file# must never stop the shell from starting.# ── aliases ──────────────────────────────────────────────────────────────────if(( $+commands[dock]))||[[ -x "$HOME/.local/bin/dock"]]; thenaliasdk='dock'aliasdku='dock up'aliasdkd='dock down'aliasdkl='dock logs'aliasdks='dock sh'aliasdkp='dock ps'aliasdkls='dock ls'fi# ── completion ───────────────────────────────────────────────────────────────# ~/.dotfiles/completions is already on fpath before compinit (core.zsh), so a# _dock there just works. This also picks one up from ~/.local/share/dock, the# macOS install location. Wrapped so any failure is swallowed.(){localcompdir="$HOME/.local/share/dock"[[ -r "$compdir/_dock"]]||return0# Only prepend if not already on fpath (idempotent across re-sources).if[[ -z "${fpath[(r)$compdir]}"]]; thenfpath=("$compdir"$fpath)fiif(( $+functions[compdef])); then# compinit already ran, so the new fpath entry was not scanned. Load the# function directly and bind it. autoload -Uz _dock 2>/dev/null && compdef _dock dock 2>/dev/null
else# compinit has not run yet; -C skips the (slow) security audit. autoload -Uz compinit && compinit -C 2>/dev/null
fi}2>/dev/null || true