Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ Algunas capas nunca forman parte de un perfil y solo se aplican si se piden con

| Capa / feature | Contenido |
| :--- | :--- |
| **`dev`** | Herramientas de desarrollo: `actionlint`, `github-cli`, `jq`, `shellcheck`, `shfmt`; comprobaciones de Docker en doctor. Requiere `cli`. |
| **`dev`** | Herramientas de desarrollo: `actionlint`, `direnv` (con su hook en zsh), `github-cli`, `hyperfine`, `jq`, `oha`, `shellcheck`, `shfmt`, `xh`; comprobaciones de Docker en doctor. Requiere `cli`. |
| **`dev-containers`** | Feature de `dev`: `docker`, `docker-compose`, `lazydocker` |
| **`dev-js`** | Feature de `dev`: `pnpm`, con sus binarios globales en el `PATH` |
| **`dev-go`** | Feature de `dev`: `go`, `golangci-lint`, `delve` |
| **`dev-tauri`** | Feature de `dev`: `rustup` y las bibliotecas de sistema de Tauri v2 (`webkit2gtk-4.1`, `libayatana-appindicator`, ...). `rustup` entra en conflicto con el paquete `rust`: desinstale `rust` antes (`sudo pacman -Rns rust`). Tras instalarla, ejecute una vez `rustup default stable`. |
| **`dev-herdr`** | Feature de `dev`: `herdr-bin` desde AUR (requiere un helper de AUR como Shelly, paru o yay), la TUI de herdr para supervisar varios agentes de código en una terminal. |

`~/.config/mimeapps.list` se genera, no se enlaza: las aplicaciones escriben en él, así que un enlace les dejaría modificar el checkout. La capa `desktop` mezcla
[`layers/desktop/mimeapps/defaults.list`](layers/desktop/mimeapps/defaults.list) en él en cada apply. Las claves del repo siempre ganan, y se conserva cualquier otra entrada que haya registrado una aplicación. `doctor` avisa cuando una clave del repo se desvió.
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ Some layers are never part of a profile and apply only when asked for with `--la

| Layer / feature | Contents |
| :--- | :--- |
| **`dev`** | Development tools: `actionlint`, `github-cli`, `jq`, `shellcheck`, `shfmt`; Docker doctor checks. Requires `cli`. |
| **`dev`** | Development tools: `actionlint`, `direnv` (hooked into zsh), `github-cli`, `hyperfine`, `jq`, `oha`, `shellcheck`, `shfmt`, `xh`; Docker doctor checks. Requires `cli`. |
| **`dev-containers`** | Feature of `dev`: `docker`, `docker-compose`, `lazydocker` |
| **`dev-js`** | Feature of `dev`: `pnpm`, with its global binaries on `PATH` |
| **`dev-go`** | Feature of `dev`: `go`, `golangci-lint`, `delve` |
| **`dev-tauri`** | Feature of `dev`: `rustup` and the Tauri v2 system libraries (`webkit2gtk-4.1`, `libayatana-appindicator`, ...). `rustup` conflicts with the `rust` package: remove `rust` first (`sudo pacman -Rns rust`). After installing, run `rustup default stable` once. |
| **`dev-herdr`** | Feature of `dev`: `herdr-bin` from AUR (needs an AUR helper such as Shelly, paru or yay), the herdr TUI to supervise several coding agents in one terminal. |

`~/.config/mimeapps.list` is generated, not linked: applications write to it, so a link would let them edit the checkout. The `desktop` layer merges
[`layers/desktop/mimeapps/defaults.list`](layers/desktop/mimeapps/defaults.list) into it on every apply. The repo's keys always win, and every other entry an application registered is kept. `doctor` warns when a repo key drifted.
Expand Down
8 changes: 4 additions & 4 deletions bin/dotfiles
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ Comandos:
Opciones:
--profile core|cli|desktop Perfil acumulativo (default: desktop).
--lang en|es Idioma de la interfaz (default: en; setup sigue a \$LANG).
--feature NOMBRE Feature opt-in (yazi-extras, dev-containers, dev-js); aplica
también la capa que la declara.
--feature NOMBRE Feature opt-in (yazi-extras, dev-containers, dev-js, dev-go, dev-tauri,
dev-herdr); aplica también la capa que la declara.
--layer NOMBRE Capa opcional que ningún perfil incluye (dev); se puede repetir.
--overlay RUTA Repositorio con layers/ propias (p. ej. ~/.dotfiles-private); cada
capa se aplica sola cuando lo que requiere está elegido.
Expand Down Expand Up @@ -290,8 +290,8 @@ Commands:
Options:
--profile core|cli|desktop Cumulative profile (default: desktop).
--lang en|es Interface language (default: en; setup follows \$LANG).
--feature NAME Opt-in feature (yazi-extras, dev-containers, dev-js); also
applies the layer declaring it.
--feature NAME Opt-in feature (yazi-extras, dev-containers, dev-js, dev-go, dev-tauri,
dev-herdr); also applies the layer declaring it.
--layer NAME Opt-in layer no profile includes (dev); repeatable.
--overlay DIR Repository with its own layers/ (e.g. ~/.dotfiles-private); each
layer applies on its own once what it requires is selected.
Expand Down
2 changes: 1 addition & 1 deletion layers/cli/home/btop/.config/btop/btop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ graph_symbol_net = "default"
graph_symbol_proc = "default"

#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
shown_boxes = "cpu mem net proc gpu0"
shown_boxes = "cpu mem net proc gpu0 gpu1"

#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 1500
Expand Down
1 change: 1 addition & 0 deletions layers/cli/packages/repo/cli.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ git-delta
glow
lazygit
micro
nvtop
sad
starship
tealdeer
Expand Down
5 changes: 5 additions & 0 deletions layers/dev/home/zsh-dev/.config/zsh/conf.d/50-dev.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ typeset -gU PATH path
path=("$PNPM_HOME" "$PNPM_HOME/bin" $path)
fi
}

# direnv loads and unloads each project's .envrc when entering its directory.
if (( $+commands[direnv] )); then
eval "$(direnv hook zsh)"
fi
9 changes: 6 additions & 3 deletions layers/dev/layer.conf
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Opt-in development tools (--layer dev); no base profile includes it.
# profiles=dev only names the tier of its own manifests (packages/*/dev.txt).
# Heavier stacks are features: --feature dev-containers, --feature dev-js.
# Heavier stacks are features: --feature dev-containers, dev-js, dev-go, dev-tauri, dev-herdr.
requires=cli
profiles=dev
features=dev-containers dev-js
features=dev-containers dev-js dev-go dev-tauri dev-herdr
prune_dirs=.config/zsh
description=Development tools: ShellCheck, shfmt, actionlint, GitHub CLI and jq
description=Development tools: ShellCheck, shfmt, actionlint, GitHub CLI, jq, direnv, xh, hyperfine and oha
description.dev-containers=Containers: Docker, Docker Compose and lazydocker
description.dev-js=JavaScript: pnpm
description.dev-go=Go: go, golangci-lint and delve
description.dev-tauri=Tauri: rustup and the WebKitGTK system libraries
description.dev-herdr=herdr: terminal workspace to supervise coding agents (AUR herdr-bin)
4 changes: 4 additions & 0 deletions layers/dev/packages/aur/dev-herdr.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# AUR development tools without an official repository package.
# herdr-bin repackages the upstream release binary of github.com/herdrdev/herdr
# with a pinned sha256 (the herdr package builds from source and lags behind).
herdr-bin
4 changes: 4 additions & 0 deletions layers/dev/packages/repo/dev-go.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Feature dev-go: Go toolchain, linter and debugger.
delve
go
golangci-lint
15 changes: 15 additions & 0 deletions layers/dev/packages/repo/dev-tauri.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Feature dev-tauri: Rust through rustup plus the Tauri v2 system libraries
# (https://v2.tauri.app/start/prerequisites/). libappindicator-gtk3 left the
# official repositories; Tauri also loads libayatana-appindicator for tray icons.
# rustup conflicts with the rust package, which must be removed first.
appmenu-gtk-module
base-devel
curl
file
libayatana-appindicator
librsvg
openssl
rustup
webkit2gtk-4.1
wget
xdotool
4 changes: 4 additions & 0 deletions layers/dev/packages/repo/dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Base development tools.
actionlint
direnv
github-cli
hyperfine
jq
oha
shellcheck
shfmt
xh
4 changes: 2 additions & 2 deletions lib/completions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _dotfiles() {
common_options=(
'--profile[Cumulative profile]:profile:(core cli desktop)'
'--lang[Interface language]:language:(en es)'
'*--feature[Opt-in feature]:feature:(yazi-extras dev-containers dev-js)'
'*--feature[Opt-in feature]:feature:(yazi-extras dev-containers dev-js dev-go dev-tauri dev-herdr)'
'*--layer[Opt-in layer]:layer:(dev)'
'(--no-overlay)--overlay[Overlay repository with its own layers/]:directory:_files -/'
'(--overlay)--no-overlay[Stop applying the saved overlay]'
Expand Down Expand Up @@ -126,7 +126,7 @@ _dotfiles_completion() {
return 0
;;
--feature)
COMPREPLY=( $(compgen -W "yazi-extras dev-containers dev-js" -- "$cur") )
COMPREPLY=( $(compgen -W "yazi-extras dev-containers dev-js dev-go dev-tauri dev-herdr" -- "$cur") )
return 0
;;
--layer)
Expand Down
8 changes: 8 additions & 0 deletions tests/cli-tools-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,12 @@ output=$(run_zsh "$with" 'z proj; zi; whence -w cd')
output=$(run_zsh "$without" 'whence -w z cd; true')
[[ "$output" == $'z: none\ncd: builtin' ]] || fail "sin zoxide aparece z o cambia cd: $output"

# btop shows a second GPU box, so a hybrid laptop's integrated and dedicated
# GPUs both appear (a missing gpu1 is ignored on single-GPU hosts).
grep -Fxq 'shown_boxes = "cpu mem net proc gpu0 gpu1"' \
"$REPO_ROOT/layers/cli/home/btop/.config/btop/btop.conf" || fail 'btop no muestra la caja gpu1'

# nvtop sees Intel and NVIDIA GPUs together, which btop may not on a laptop.
grep -Fxq nvtop "$REPO_ROOT/layers/cli/packages/repo/cli.txt" || fail 'la capa cli no instala nvtop'

printf 'PASS: cli tools (eza, zoxide, tealdeer, dust, duf)\n'
54 changes: 54 additions & 0 deletions tests/optional-layers-smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ FAKE_BIN="$TEST_ROOT/fake-bin"
mkdir -p "$FAKE_BIN"
printf '#!/usr/bin/env bash\nexit 0\n' > "$FAKE_BIN/pacman"
chmod +x "$FAKE_BIN/pacman"
# A fake AUR helper, so plans that need AUR do not depend on the host having one.
ln -s /usr/bin/true "$FAKE_BIN/shelly"

H="$TEST_ROOT/home"
RECEIPT="$H/.local/state/dotfiles/dotfiles.receipt"
Expand All @@ -56,6 +58,21 @@ plan_packages() {
run bootstrap --packages-only --backend pacman --platform arch --target "$H" "$@" 2>&1
}

# Whether the repo packages of a plan section $1 include the exact name $2
# (a substring test would let `go` pass on golangci-lint or "Features: dev-go").
plans_repo_package() {
local packages
packages=$(awk '/Paquetes repo:/ { sub(/.*Paquetes repo: */, ""); print; exit }' <<< "$1")
[[ " $packages " == *" $2 "* ]]
}

# Same as plans_repo_package, for the AUR packages of a plan section.
plans_aur_package() {
local packages
packages=$(awk '/Paquetes AUR:/ { sub(/.*Paquetes AUR: */, ""); print; exit }' <<< "$1")
[[ " $packages " == *" $2 "* ]]
}

# The help documents the selector.
output=$(run help)
[[ "$output" == *'--layer'* ]] || fail "la ayuda no documenta --layer"
Expand All @@ -73,6 +90,12 @@ output=$(plan_packages --profile core --layer dev) || fail "el plan con --layer
dev_plan=$(layer_section "$output" dev)
[[ -n "$dev_plan" ]] || fail "--layer dev no planificó la capa dev: $output"
[[ "$dev_plan" == *shellcheck* ]] || fail "la capa dev no planificó sus herramientas base: $dev_plan"
plans_repo_package "$dev_plan" direnv || fail "la capa dev no planificó direnv: $dev_plan"
plans_repo_package "$dev_plan" xh || fail "la capa dev no planificó xh: $dev_plan"
for package in hyperfine oha; do
plans_repo_package "$dev_plan" "$package" || fail "la capa dev no planificó $package: $dev_plan"
done
! plans_aur_package "$dev_plan" herdr-bin || fail "la capa dev base planificó herdr-bin de AUR: $dev_plan"
[[ "$dev_plan" != *docker* && "$dev_plan" != *pnpm* ]] || fail "la capa dev planificó features no pedidas: $dev_plan"

# A feature of an opt-in layer pulls the layer in and adds its packages.
Expand All @@ -81,6 +104,22 @@ dev_plan=$(layer_section "$output" dev)
[[ "$dev_plan" == *docker* ]] || fail "dev-containers no añadió docker a la capa dev: $output"
output=$(plan_packages --profile core --feature dev-js) || fail "el plan con dev-js falló: $output"
[[ "$(layer_section "$output" dev)" == *pnpm* ]] || fail "dev-js no añadió pnpm a la capa dev: $output"
output=$(plan_packages --profile core --feature dev-go) || fail "el plan con dev-go falló: $output"
dev_plan=$(layer_section "$output" dev)
for package in go golangci-lint delve; do
plans_repo_package "$dev_plan" "$package" || fail "dev-go no añadió $package a la capa dev: $output"
done
output=$(plan_packages --profile core --feature dev-tauri) || fail "el plan con dev-tauri falló: $output"
dev_plan=$(layer_section "$output" dev)
for package in rustup webkit2gtk-4.1 base-devel libayatana-appindicator librsvg xdotool; do
plans_repo_package "$dev_plan" "$package" || fail "dev-tauri no añadió $package a la capa dev: $output"
done
! plans_repo_package "$dev_plan" golangci-lint || fail "dev-tauri planificó paquetes de dev-go: $dev_plan"
# dev-herdr adds an AUR package, so it plans with an AUR backend.
output=$(plan_packages --profile core --feature dev-herdr --backend shelly) || \
fail "el plan con dev-herdr falló: $output"
dev_plan=$(layer_section "$output" dev)
plans_aur_package "$dev_plan" herdr-bin || fail "dev-herdr no añadió herdr-bin desde AUR: $output"

# --feature dev-containers alone raises the profile to cli too.
output=$(plan_packages --profile core --feature dev-containers) || fail "el plan con dev-containers falló: $output"
Expand Down Expand Up @@ -131,6 +170,21 @@ output=$(dev_env "$PNPM_PACKAGED/home" "$PNPM_PACKAGED/bin")
packaged_home="$PNPM_PACKAGED/home/.local/share/pnpm"
[[ "$output" == "$packaged_home $packaged_home:$packaged_home/bin:$PNPM_PACKAGED/bin" ]] || \
fail "con un pnpm empaquetado la capa dev no preparó el PATH: $output"

# With direnv installed the layer's zsh file loads its shell hook; without it,
# it does nothing.
direnv_hooked() {
# shellcheck disable=SC2016 # expanded by the zsh it runs
env HOME="$H" PATH="$1" "$ZSH_BIN" -dfc \
'source "$1"; print -r -- "${DIRENV_HOOKED:-no}"' _ "$dev_link"
}
DIRENV_BIN="$TEST_ROOT/direnv-bin"
mkdir -p "$DIRENV_BIN"
# shellcheck disable=SC2016 # expanded by the fake direnv
printf '#!/bin/sh\n[ "$1 $2" = "hook zsh" ] && echo DIRENV_HOOKED=yes\n' > "$DIRENV_BIN/direnv"
chmod +x "$DIRENV_BIN/direnv"
[[ $(direnv_hooked "$DIRENV_BIN") == yes ]] || fail 'con direnv la capa dev no cargó su hook de zsh'
[[ $(direnv_hooked "$PNPM_NONE") == no ]] || fail 'sin direnv la capa dev intentó cargar su hook'
mkdir -p "$pnpm_home/bin"
printf '#!/bin/sh\n' > "$pnpm_home/pnpm"
chmod +x "$pnpm_home/pnpm"
Expand Down
Loading