Compare commits
8 Commits
880e1376da
...
9724ef1aa2
| Author | SHA1 | Date | |
|---|---|---|---|
| 9724ef1aa2 | |||
| 856e3d33f9 | |||
| 6bd3caf622 | |||
| 49cf283770 | |||
| 561cb4038f | |||
| d98529f30b | |||
| 3e76a82cb2 | |||
| 0147f7f0a9 |
@@ -12,10 +12,11 @@ DOTDIR="/var/lib/dotfiles"
|
||||
|
||||
os_release_file=/etc/os-release
|
||||
if [[ ! -e "${os_release_file}" ]] ; then
|
||||
2>&1 printf "Could not find ${os_release_file}, exiting"
|
||||
2>&1 printf 'Could not find %, exiting' "${os_release_file}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# shellcheck source=/etc/os-release
|
||||
source "${os_release_file}"
|
||||
|
||||
sudowrap() {
|
||||
@@ -37,7 +38,7 @@ install() {
|
||||
fi
|
||||
sudowrap pacman -S --needed --noconfirm "${package}"
|
||||
else
|
||||
2>&1 printf "Unsupported distro $NAME, exiting"
|
||||
2>&1 printf 'Unsupported distro %s, exiting' "$NAME"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@ pacman -Sy --noconfirm git # yes its a partial upgrade, but thats just the live
|
||||
cd /root
|
||||
git clone --recursive https://code.hkoerber.de/hannes/dotfiles.git
|
||||
|
||||
./dotfiles/install_scripts/${host}.sh
|
||||
./dotfiles/install_scripts/"${host}".sh
|
||||
|
||||
mv /root/dotfiles /mnt/var/lib/dotfiles
|
||||
|
||||
read -p "> Ready for reboot. Press enter for shutdown, then remove the installation media and boot again "
|
||||
read -rp "> Ready for reboot. Press enter for shutdown, then remove the installation media and boot again "
|
||||
|
||||
poweroff
|
||||
|
||||
38
packages.yml
38
packages.yml
@@ -2,8 +2,17 @@ packages:
|
||||
list:
|
||||
kernel:
|
||||
archlinux:
|
||||
- linux-zen
|
||||
- linux-zen-headers
|
||||
- linux-zen-docs
|
||||
- linux-firmware
|
||||
grub:
|
||||
archlinux:
|
||||
- grub
|
||||
- efibootmgr
|
||||
lvm:
|
||||
archlinux:
|
||||
- lvm2
|
||||
build-essentials:
|
||||
archlinux:
|
||||
- gcc
|
||||
@@ -42,16 +51,15 @@ packages:
|
||||
archlinux:
|
||||
- ansible
|
||||
- ansible-language-server
|
||||
- python-jmespath
|
||||
xdotool:
|
||||
archlinux: ["xdotool"]
|
||||
arandr:
|
||||
archlinux: ["arandr"]
|
||||
borgbackup:
|
||||
archlinux: ["borgbackup"]
|
||||
docker:
|
||||
archlinux: ["docker", "docker-compose"]
|
||||
font-awesome:
|
||||
archlinux: ["ttf-font-awesome"]
|
||||
archlinux: ["ttf-font-awesome", "otf-font-awesome"]
|
||||
font-inconsolata:
|
||||
archlinux: ["ttf-inconsolata"]
|
||||
font-dejavu:
|
||||
@@ -62,7 +70,7 @@ packages:
|
||||
archlinux: ["noto-fonts-emoji"]
|
||||
git:
|
||||
# tk required for gitk
|
||||
archlinux: ["git", "tk", "git-delta"]
|
||||
archlinux: ["git", "tk", "git-delta", "git-filter-repo"]
|
||||
htop:
|
||||
archlinux: ["htop"]
|
||||
feh:
|
||||
@@ -77,6 +85,8 @@ packages:
|
||||
archlinux: ["pluma"]
|
||||
neovim:
|
||||
archlinux: ["neovim", "python-pynvim"]
|
||||
vim:
|
||||
archlinux: ["vim"]
|
||||
network-manager-applet:
|
||||
archlinux: ["network-manager-applet"]
|
||||
pasystray:
|
||||
@@ -104,9 +114,9 @@ packages:
|
||||
pdf:
|
||||
archlinux: ["ghostscript", "enscript"]
|
||||
pandoc:
|
||||
archlinux: ["pandoc", "texlive-core", "texlive-fontsextra", "texlive-latexextra"]
|
||||
archlinux: ["pandoc-cli", "texlive-basic", "texlive-fontsextra", "texlive-latexextra"]
|
||||
libvirt:
|
||||
archlinux: ["virt-manager", "libvirt", "dnsmasq", "ebtables", "dmidecode", "virt-install", "virt-viewer", "libguestfs", "edk2-ovmf"]
|
||||
archlinux: ["virt-manager", "libvirt", "dnsmasq", "iptables-nft", "dmidecode", "virt-install", "virt-viewer", "libguestfs", "edk2-ovmf"]
|
||||
firefox:
|
||||
archlinux: ["firefox"]
|
||||
ranger:
|
||||
@@ -125,7 +135,7 @@ packages:
|
||||
archlinux: ["xcompmgr"]
|
||||
python:
|
||||
archlinux:
|
||||
- python3
|
||||
- python
|
||||
- python-lsp-server
|
||||
python-modules:
|
||||
archlinux:
|
||||
@@ -171,7 +181,7 @@ packages:
|
||||
gpg:
|
||||
archlinux: ["gnupg", "paperkey", "yubikey-manager", "yubikey-touch-detector"]
|
||||
networkmanager:
|
||||
archlinux: ["networkmanager"]
|
||||
archlinux: ["networkmanager", "capnet-assist"]
|
||||
pulseaudio:
|
||||
archlinux:
|
||||
- pulseaudio
|
||||
@@ -301,7 +311,7 @@ packages:
|
||||
php:
|
||||
archlinux: ["php"]
|
||||
exa:
|
||||
archlinux: ["exa"]
|
||||
archlinux: ["eza"]
|
||||
just:
|
||||
archlinux: ["just"]
|
||||
ripgrep:
|
||||
@@ -413,17 +423,23 @@ packages:
|
||||
- ruff
|
||||
mold:
|
||||
archlinux:
|
||||
- clang
|
||||
- mold
|
||||
arch-packaging:
|
||||
archlinux:
|
||||
- namcap
|
||||
- devtools
|
||||
dron:
|
||||
- arch-install-scripts
|
||||
- archiso
|
||||
drone:
|
||||
archlinux:
|
||||
- drone-cli
|
||||
sqlite:
|
||||
archlinux:
|
||||
- sqlite
|
||||
css:
|
||||
archlinux:
|
||||
- vscode-css-languageserver
|
||||
|
||||
remove:
|
||||
mousepad:
|
||||
@@ -442,3 +458,5 @@ packages:
|
||||
archlinux: ["openvpn"]
|
||||
bluetooth:
|
||||
archlinux: ["bluez", "bluez-tools", "blueman"]
|
||||
borgbackup:
|
||||
archlinux: ["borg"]
|
||||
|
||||
Submodule pkgbuilds/portfolio-performance-bin updated: 035cfcc72e...86b153e614
41
remove-unconfigured-packages.sh
Executable file
41
remove-unconfigured-packages.sh
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
declare -a aurdeps=()
|
||||
|
||||
proctected=(
|
||||
nvidia-dkms
|
||||
intel-ucode
|
||||
amd-ucode
|
||||
base
|
||||
java-runtime-common
|
||||
jdk17-openjdk
|
||||
)
|
||||
|
||||
for pkgbuild in pkgbuilds/*/PKGBUILD ; do
|
||||
source "${pkgbuild}"
|
||||
aurdeps+=("${depends[@]%%[<=>]*}" "${makedepends[@]%%[<=>]*}" "${pkgname}")
|
||||
done
|
||||
|
||||
packages_to_remove=()
|
||||
|
||||
readarray -d $'\0' -t packages_to_remove < <(comm --zero-terminated -13 \
|
||||
<(cat \
|
||||
<(<packages.yml yaml2json | jq --raw-output0 '.packages.list | map(.archlinux) | flatten[]') \
|
||||
<(for dep in "${aurdeps[@]}" ; do printf '%s\0' "${dep}" ; done) \
|
||||
| sort -zu) \
|
||||
<(pacman -Qq --explicit | xargs -I "{}" printf '%s\0' "{}" | sort -zu) \
|
||||
| while IFS= read -r -d $'\0' package; do
|
||||
skip=0
|
||||
for protected in "${proctected[@]}" ; do
|
||||
if [[ "${package}" == "${protected}" ]] ; then
|
||||
skip=1
|
||||
fi
|
||||
done
|
||||
if (( skip )) ; then
|
||||
continue
|
||||
fi
|
||||
printf '%s\0' "${package}"
|
||||
done)
|
||||
|
||||
sudo pacman -Rcns "${packages_to_remove[@]}"
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o nounset
|
||||
set -o errexit
|
||||
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
trap "rm -rf ${tmpdir}" EXIT
|
||||
|
||||
git archive --format tar --output "${tmpdir}/dotfiles.tar" HEAD
|
||||
|
||||
git submodule foreach 'bash -x -c "
|
||||
set -o errexit
|
||||
git archive --prefix $path/ HEAD --output '"${tmpdir}/submod.tar"'
|
||||
tar -i --concatenate --file='"${tmpdir}/dotfiles.tar"' '"${tmpdir}/submod.tar"'
|
||||
rm '"${tmpdir}/submod.tar"'
|
||||
"'
|
||||
|
||||
gzip -k -f -v "${tmpdir}/dotfiles.tar"
|
||||
|
||||
test_ares() {
|
||||
if [[ -d "/var/cache/pacman/pkg/" ]] ; then
|
||||
dockeropts=(-v "/var/cache/pacman/pkg/:/var/cache/pacman/pkg_host/")
|
||||
else
|
||||
echo "Warning: /var/cache/pacman/pkg/ does not exist. Create it to speed up multiple runs" >&2
|
||||
fi
|
||||
docker pull docker.io/library/archlinux:base
|
||||
docker run \
|
||||
-ti \
|
||||
--rm \
|
||||
-v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro \
|
||||
--mount type=tmpfs,destination=/var/cache/pacman/pkg/ \
|
||||
"${dockeropts[@]}" \
|
||||
--hostname ares \
|
||||
docker.io/library/archlinux:base \
|
||||
sh -c '
|
||||
set -o errexit
|
||||
|
||||
# Uncomment CacheDir and append the host pacman cache as cachedir
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always prefer the first cache directory, so newly downloaded
|
||||
# packages will stay in the container
|
||||
sed -i '"'"'s/^#\?\(CacheDir.*\)/CacheDir = \/var\/cache\/pacman\/pkg_host\/\n\1/'"'"' /etc/pacman.conf
|
||||
|
||||
mkdir -p /var/cache/pacman/pkg_host/
|
||||
pacman -Syu --noconfirm linux
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
}
|
||||
|
||||
test_neptune() {
|
||||
docker run \
|
||||
-ti \
|
||||
--rm \
|
||||
-v ${tmpdir}/dotfiles.tar.gz:/tmp/dotfiles.tar.gz:ro \
|
||||
--mount type=tmpfs,destination=/var/cache/pacman/pkg/ \
|
||||
"${dockeropts[@]}" \
|
||||
--hostname neptune \
|
||||
docker.io/library/archlinux:base \
|
||||
sh -c '
|
||||
set -o errexit
|
||||
|
||||
# Uncomment CacheDir and append the host pacman cache as cachedir
|
||||
# At worst, the cache directory will be ignored if it does not exist
|
||||
# Pacman will always prefer the first cache directory, so newly downloaded
|
||||
# packages will stay in the container
|
||||
sed -i '"'"'s/^#\?\(CacheDir.*\)/CacheDir = \/var\/cache\/pacman\/pkg_host\/\n\1/'"'"' /etc/pacman.conf
|
||||
|
||||
mkdir -p /var/cache/pacman/pkg_host/
|
||||
pacman -Syu --noconfirm linux
|
||||
cd $(mktemp -d)
|
||||
tar xf /tmp/dotfiles.tar.gz -C .
|
||||
ANSIBLE_EXTRA_ARGS="-e manage_services=false" ./install.sh
|
||||
'
|
||||
}
|
||||
|
||||
case "${1:-all}" in
|
||||
ares)
|
||||
test_ares
|
||||
;;
|
||||
neptune)
|
||||
test_neptune
|
||||
;;
|
||||
all)
|
||||
test_ares
|
||||
test_neptune
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user