From e566857dfd809a7ce158da8bb7da8d3a9cd9763e Mon Sep 17 00:00:00 2001 From: "Guilhem C." Date: Wed, 22 Apr 2026 22:43:53 +0200 Subject: [PATCH 1/2] feat(chezmoi): install CLI tools on Linux via cargo install --locked On macOS the Brewfile already covers these; on Linux there's no brew, so bootstrap rustup and `cargo install --locked` the Rust CLIs that mirror the Brewfile (bat, broot, dog, dust, eza, fd, delta, ripgrep, tealdeer, zoxide). fzf is Go, fetched from the upstream GitHub release into ~/.local/bin. Also add `brew "dog"` to the macOS Brewfile for parity (only tool from the Linux set that wasn't already there), and generate $ZDOTDIR/fzf-completion.zsh in run_once_after_99_misc.sh so the zshrc's conditional source has something to read, regardless of how fzf got installed. Co-Authored-By: Claude Opus 4.7 (1M context) --- .chezmoiscripts/run_once_after_99_misc.sh | 6 +++ .../run_once_before_00_init.sh.tmpl | 40 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/.chezmoiscripts/run_once_after_99_misc.sh b/.chezmoiscripts/run_once_after_99_misc.sh index f1b476d..5d2e55c 100644 --- a/.chezmoiscripts/run_once_after_99_misc.sh +++ b/.chezmoiscripts/run_once_after_99_misc.sh @@ -3,3 +3,9 @@ mkdir -p "${XDG_STATE_HOME:-$HOME/.state}/zsh/" bat cache --build tldr --update + +# Generate fzf zsh integration — the zshrc sources $ZDOTDIR/fzf-completion.zsh +# conditionally, so this file defines the keybindings and completion. +ZDOTDIR="${ZDOTDIR:-${XDG_CONFIG_HOME:-$HOME/.config}/zsh}" +mkdir -p "$ZDOTDIR" +fzf --zsh >"$ZDOTDIR/fzf-completion.zsh" diff --git a/.chezmoiscripts/run_once_before_00_init.sh.tmpl b/.chezmoiscripts/run_once_before_00_init.sh.tmpl index 16dbf8f..d2b7caf 100644 --- a/.chezmoiscripts/run_once_before_00_init.sh.tmpl +++ b/.chezmoiscripts/run_once_before_00_init.sh.tmpl @@ -49,6 +49,7 @@ brew "coreutils" brew "crane" brew "curl" brew "dive" +brew "dog" brew "dust" brew "eza" brew "fd" @@ -170,5 +171,44 @@ EOF echo "Package installation completed." +# shellcheck disable=1054,1083 +{{ end -}} + +# shellcheck disable=1054,1083 +{{- if eq .chezmoi.os "linux" }} +# Linux has no brew; bootstrap Rust and `cargo install` the CLIs that mirror +# the macOS Brewfile. `cargo install` is idempotent — re-runs skip crates +# already at the installed version. +if ! command -v cargo &>/dev/null; then + echo "🦀 Installing Rust toolchain" + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \ + | sh -s -- --default-toolchain stable --no-modify-path -y +fi +# shellcheck disable=SC1091 +source "$HOME/.cargo/env" + +echo "📦 Installing Rust CLIs via cargo install" +cargo install --locked \ + bat \ + broot \ + dog \ + du-dust \ + eza \ + fd-find \ + git-delta \ + ripgrep \ + tealdeer \ + zoxide + +# fzf is Go (not on crates.io); fetch the upstream release into ~/.local/bin. +if ! command -v fzf &>/dev/null; then + echo "📦 Installing fzf" + mkdir -p "$HOME/.local/bin" + FZF_VERSION=$(curl -fsSL https://api.github.com/repos/junegunn/fzf/releases/latest \ + | grep -m1 '"tag_name":' | sed 's/.*"v\(.*\)".*/\1/') + curl -fsSL "https://github.com/junegunn/fzf/releases/download/v${FZF_VERSION}/fzf-${FZF_VERSION}-linux_amd64.tar.gz" \ + | tar -xz -C "$HOME/.local/bin" +fi + # shellcheck disable=1054,1083 {{ end -}} From 1d18862af69c7480e517e624f29e87e50bdd25a1 Mon Sep 17 00:00:00 2001 From: "Guilhem C." Date: Wed, 22 Apr 2026 22:46:07 +0200 Subject: [PATCH 2/2] fix(chezmoi): install dog from github release, not crates.io The `dog` crate on crates.io is an unrelated/empty library; `cargo install dog` fails with "there is nothing to install... because it has no binaries". The DNS client lives at ogham/dog on GitHub and has a single v0.1.0 release (the project has been dormant since 2020). Drop it from the cargo install list and fetch the prebuilt release instead, matching the fzf pattern. Co-Authored-By: Claude Opus 4.7 (1M context) --- .chezmoiscripts/run_once_before_00_init.sh.tmpl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.chezmoiscripts/run_once_before_00_init.sh.tmpl b/.chezmoiscripts/run_once_before_00_init.sh.tmpl index d2b7caf..6ed2194 100644 --- a/.chezmoiscripts/run_once_before_00_init.sh.tmpl +++ b/.chezmoiscripts/run_once_before_00_init.sh.tmpl @@ -191,7 +191,6 @@ echo "📦 Installing Rust CLIs via cargo install" cargo install --locked \ bat \ broot \ - dog \ du-dust \ eza \ fd-find \ @@ -210,5 +209,19 @@ if ! command -v fzf &>/dev/null; then | tar -xz -C "$HOME/.local/bin" fi +# dog (DNS client) isn't on crates.io; fetch the upstream release. Only v0.1.0 +# exists — the project has been dormant since 2020. +if ! command -v dog &>/dev/null; then + echo "📦 Installing dog" + command -v unzip &>/dev/null || sudo apt-get install -y -qq unzip + mkdir -p "$HOME/.local/bin" + tmp=$(mktemp -d) + curl -fsSL "https://github.com/ogham/dog/releases/download/v0.1.0/dog-v0.1.0-x86_64-unknown-linux-gnu.zip" \ + -o "$tmp/dog.zip" + unzip -q "$tmp/dog.zip" -d "$tmp" + install -m 0755 "$tmp/bin/dog" "$HOME/.local/bin/dog" + rm -rf "$tmp" +fi + # shellcheck disable=1054,1083 {{ end -}}