Compare commits

...

8 Commits

Author SHA1 Message Date
9724ef1aa2 Only call kill when there are background jobs 2024-05-02 18:05:56 +02:00
856e3d33f9 Fix packages list 2024-05-02 17:18:32 +02:00
6bd3caf622 Remove docker test script 2024-05-02 17:11:03 +02:00
49cf283770 Update packages 2024-05-02 17:10:58 +02:00
561cb4038f Make shellcheck happy 2024-05-02 17:10:45 +02:00
d98529f30b Add script to remove unconfigured packages 2024-05-02 17:10:31 +02:00
3e76a82cb2 Install clang with mold 2024-04-29 19:06:35 +02:00
0147f7f0a9 portfolio: v0.68.4 2024-04-29 19:06:26 +02:00
7 changed files with 78 additions and 106 deletions

View File

@@ -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
}

View File

@@ -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

View File

@@ -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"]

41
remove-unconfigured-packages.sh Executable file
View 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[@]}"

View File

@@ -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

View File

@@ -18,7 +18,9 @@ cleanup() {
rm -rf "${tmpdir}"
pids=()
jobs -p | while IFS="" read -r line; do pids+=("$line"); done
kill "${pids[@]}"
if (( "${#pids[@]}" > 0)) ; then
kill "${pids[@]}"
fi
}
download_iso() {