2024-04-27 15:53:34 -07:00
|
|
|
{{ if lookPath "yay" -}}
|
2024-04-15 20:03:34 -07:00
|
|
|
#!/usr/bin/env fish
|
|
|
|
|
|
|
|
{{ range (glob ".config/packages/arch?*") -}}
|
|
|
|
# {{ include (joinPath "dot_config/packages/" (base .)) | sha256sum }}
|
|
|
|
{{ end -}}
|
|
|
|
|
2024-04-20 10:27:48 -07:00
|
|
|
cd "$HOME/.config/packages/"
|
|
|
|
|
2024-04-15 20:03:34 -07:00
|
|
|
set file (\
|
2024-04-20 10:27:48 -07:00
|
|
|
find . -type f -iname "arch?*" -print0\
|
2024-04-15 20:03:34 -07:00
|
|
|
| xargs -0 ls -tr\
|
|
|
|
| tail -n 1\
|
|
|
|
| string sub -s 3\
|
|
|
|
)
|
|
|
|
|
|
|
|
cp $file arch
|
|
|
|
|
2024-05-26 15:26:52 -07:00
|
|
|
{{ range .packages.arch -}}
|
|
|
|
{{ range . -}}
|
2024-04-15 20:03:34 -07:00
|
|
|
sed -i '/{{ . }}/d' arch
|
2024-05-26 15:26:52 -07:00
|
|
|
{{ end -}}
|
2024-04-15 20:03:34 -07:00
|
|
|
{{ end -}}
|
|
|
|
|
|
|
|
if ! test "{{ .chezmoi.hostname }}" = "$file"
|
2024-04-18 21:36:17 -07:00
|
|
|
set_color yellow && echo "Package list has changed, reinstalling..."
|
|
|
|
yay -S --needed - <~/.config/packages/arch
|
2024-06-20 17:42:36 -07:00
|
|
|
|
2024-06-20 17:51:22 -07:00
|
|
|
{{ if eq .chezmoi.hostname "archgirlie" -}}
|
|
|
|
{{ range .packages.arch.archgirlie -}}
|
|
|
|
yay -S --needed - <{{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
{{ else if eq .chezmoi.hostname "archbaby" -}}
|
|
|
|
{{ range .packages.arch.archbaby -}}
|
2024-06-20 17:42:36 -07:00
|
|
|
yay -S --needed - <{{ . }}
|
|
|
|
{{ end -}}
|
|
|
|
{{ end -}}
|
2024-04-15 20:03:34 -07:00
|
|
|
end
|
2024-04-18 21:36:17 -07:00
|
|
|
|
|
|
|
yay -Qeq >{{ joinPath .chezmoi.sourceDir "dot_config/packages" .chezmoi.hostname }}
|
2024-04-20 10:27:48 -07:00
|
|
|
|
|
|
|
cd "$HOME"
|
2024-04-15 20:03:34 -07:00
|
|
|
{{ end -}}
|