-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
54 lines (41 loc) · 1.49 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
aur_helper := "paru"
pacman_args := "--needed"
default:
just --list
quick-apply:
chezmoi apply --exclude scripts
apply:
chezmoi apply
custom-packages:
#!/usr/bin/env bash
set -euo pipefail
for pkg in _files/alr/*; do
pushd $pkg
[ -f PKGBUILD ] && PACMAN={{ aur_helper }} makepkg -si --needed --noconfirm
popd
done
sync-packages: aur-helper custom-packages
git pull --autostash
@{{aur_helper}} {{pacman_args}} -Syu
@{{aur_helper}} {{pacman_args}} -Sy $(cat _files/packages | tr '\n' ' ')
hooks: packages-hook
packages-hook:
cp ./_files/pre-commit-hook.sh .git/hooks/pre-commit
@chmod +x .git/hooks/pre-commit
chaotic-aur:
#!/usr/bin/env -S sudo bash
set -euo pipefail
CHEZMOI_MARKER="### Added by chezmoi ###"
if [ -z "$(grep "$CHEZMOI_MARKER" /etc/pacman.conf)" ]; then
echo $CHEZMOI_MARKER >> /etc/pacman.conf
echo "[multilib]" >> /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
pacman-key --lsign-key 3056513887B78AEB
pacman {{pacman_args}} -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
pacman {{pacman_args}} -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
echo "[chaotic-aur]" >> /etc/pacman.conf
echo "Include = /etc/pacman.d/chaotic-mirrorlist" >> /etc/pacman.conf
fi
aur-helper: chaotic-aur
which {{aur_helper}} || sudo pacman -Sy {{pacman_args}} {{aur_helper}}