aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/justfile
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:27 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:27 +0100
commit04896c78095dc0f568ca758f789178fc909302e5 (patch)
tree9c44be690107766a4a00e64ab25d477f0e151452 /justfile
parent7ef0202e2eee0feaeac3041fe2643f4d3b82ce3d (diff)
downloaddotfiles-04896c78095dc0f568ca758f789178fc909302e5.tar.gz
dotfiles-04896c78095dc0f568ca758f789178fc909302e5.tar.bz2
dotfiles-04896c78095dc0f568ca758f789178fc909302e5.zip
feat: split drift recipes and add 'just undeclared'
- 'just status' now a thin wrapper for 'pkg-drift + dotfile-drift' - 'just pkg-drift' and 'just dotfile-drift' are individually addressable - 'just undeclared' prints undeclared packages unindented, one per line, so they pipe cleanly into 'paru -Rs -' - pkg-drift reuses 'just undeclared' via sed to avoid duplicating logic
Diffstat (limited to 'justfile')
-rw-r--r--justfile26
1 files changed, 19 insertions, 7 deletions
diff --git a/justfile b/justfile
index fabe4f0..fb6b10b 100644
--- a/justfile
+++ b/justfile
@@ -44,8 +44,11 @@ fix:
# Inspection
# ═══════════════════════════════════════════════════════════════════
-# Show package and dotfile drift (only for groups ≥50% installed)
-status:
+# Show package and dotfile drift (runs pkg-drift + dotfile-drift)
+status: pkg-drift dotfile-drift
+
+# Show package drift: missing packages in adopted groups + undeclared installed packages
+pkg-drift:
#!/bin/sh
active_file=$(mktemp)
trap 'rm -f "$active_file"' EXIT
@@ -61,19 +64,28 @@ status:
fi
done
active=$(sort -u "$active_file")
- declared=$(cat meta/*.txt | grep -v '^\s*#' | grep -v '^\s*$' | sort -u)
echo "=== Package drift ==="
echo "$active" | while read -r pkg; do
[ -z "$pkg" ] && continue
pacman -Qi "$pkg" >/dev/null 2>&1 || echo " missing: $pkg"
done
- pacman -Qqe | while read -r pkg; do
- echo "$declared" | grep -qxF "$pkg" || echo " undeclared: $pkg"
- done
- echo ""
+ just undeclared | sed 's/^/ undeclared: /'
+
+# Show dotfile drift (wraps 'chezmoi status')
+dotfile-drift:
+ #!/bin/sh
echo "=== Dotfile drift ==="
chezmoi status -S . || true
+# Print undeclared packages (installed but not in any meta/*.txt), one per line, unindented
+# Pipeable: just undeclared | paru -Rs -
+undeclared:
+ #!/bin/sh
+ declared=$(cat meta/*.txt | grep -v '^\s*#' | grep -v '^\s*$' | sort -u)
+ pacman -Qqe | while read -r pkg; do
+ echo "$declared" | grep -qxF "$pkg" || echo "$pkg"
+ done
+
# Show dotfile diffs; pass a path to limit to a single file (e.g. just diff .config/nvim/init.lua)
diff file="":
chezmoi diff -S . {{ file }}