aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:20 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-04-21 01:23:20 +0100
commit7e3e04b8f0a61a8a20928202c102c9dab0d1824a (patch)
treed09c93626c454663b07cef7f6f90bff1910cfb50
parenta93494aa2aa48583142594cfe6c005851046f16b (diff)
downloaddotfiles-7e3e04b8f0a61a8a20928202c102c9dab0d1824a.tar.gz
dotfiles-7e3e04b8f0a61a8a20928202c102c9dab0d1824a.tar.bz2
dotfiles-7e3e04b8f0a61a8a20928202c102c9dab0d1824a.zip
feat: add 'just add <group> <pkg>' recipe
Appends the package to meta/<group>.txt (if not already present) and installs it via paru --needed. Equivalent to chezmoi add for packages.
-rw-r--r--.github/copilot-instructions.md2
-rw-r--r--justfile17
2 files changed, 18 insertions, 1 deletions
diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md
index 5f53abb..30c6c19 100644
--- a/.github/copilot-instructions.md
+++ b/.github/copilot-instructions.md
@@ -15,7 +15,7 @@ The repo root is a chezmoi source directory. Files targeting `$HOME` use chezmoi
- `create-efi.sh` is an interactive EFI boot entry creation script using `efibootmgr`.
- `.chezmoiignore` excludes non-home files (`etc/`, `meta/`, `firefox/`, docs) from deployment to `$HOME`.
- `.githooks/` contains git hooks (notably `post-commit` which runs `chezmoi apply`). Activate with `just install-hooks`.
-- `justfile` provides recipes: `install-hooks`, `apply`, `install`, `install-all`, `status`.
+- `justfile` provides recipes: `install-hooks`, `apply`, `install`, `install-all`, `add`, `status`.
## Window manager
diff --git a/justfile b/justfile
index c14a8fc..fe1cc65 100644
--- a/justfile
+++ b/justfile
@@ -18,6 +18,23 @@ install-all:
#!/bin/sh
cat meta/*.txt | grep -v '^\s*#' | grep -v '^\s*$' | sort -u | paru -S --needed -
+# Add a package to a group and install it (e.g. just add dev ripgrep)
+add group pkg:
+ #!/bin/sh
+ set -eu
+ file="meta/{{ group }}.txt"
+ if [ ! -f "$file" ]; then
+ echo "error: $file does not exist" >&2
+ exit 1
+ fi
+ if grep -qxF '{{ pkg }}' "$file"; then
+ echo "{{ pkg }} already in {{ group }}.txt"
+ else
+ echo '{{ pkg }}' >> "$file"
+ echo "added {{ pkg }} to {{ group }}.txt"
+ fi
+ paru -S --needed '{{ pkg }}'
+
# Show package and dotfile drift
status:
#!/bin/sh