1
0
Fork 0
mirror of https://github.com/Phantop/dotfiles synced 2024-12-17 19:05:04 +00:00

add setup script testing workflow

This commit is contained in:
Phantop 2024-10-25 12:18:45 -04:00
parent c83c7a5c17
commit ab8abc1979
6 changed files with 107 additions and 17 deletions

33
.github/workflows/setup.yml vendored Normal file
View file

@ -0,0 +1,33 @@
name: Test dotfiles run
on:
workflow_dispatch: # allow manual trigger
push:
branches:
- main
jobs:
setup: # try setting up user with setup script
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Install git on container and add user
run: |
pacman -Sy --noconfirm git opendoas
pacman-key --init
useradd -m glados -G wheel
echo permit nopass :wheel > /etc/doas.conf
- name: Checkout repo
uses: actions/checkout@v4
- name: Run setup
run: |
cp -r /__w/dotfiles/dotfiles /home/glados/.dotfiles
su glados -c /home/glados/.dotfiles/bin/setup
mkdwarfs -i /home/glados -o /home.dwarfs
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: home.dwarfs
path: /home.dwarfs

4
arch/devkitpro.conf Normal file
View file

@ -0,0 +1,4 @@
[dkp-libs]
Server = https://pkg.devkitpro.org/packages
[dkp-linux]
Server = https://pkg.devkitpro.org/packages/linux/$arch/

38
arch/dwarfs-universal Normal file
View file

@ -0,0 +1,38 @@
# Maintainer: phantop <phantop@tuta.io>
pkgname=dwarfs-universal
pkgver=0.10.1
pkgrel=1
pkgdesc='A fast high compression read-only file system (pre-compiled binaries)'
url='https://github.com/mhx/dwarfs'
source=("https://github.com/mhx/dwarfs/releases/download/v${pkgver}/dwarfs-${pkgver}-Linux-${CARCH}-clang.tar.xz"
"https://github.com/mhx/dwarfs/releases/download/v${pkgver}/dwarfs-universal-${pkgver}-Linux-${CARCH}-clang"
"https://github.com/mhx/dwarfs/raw/main/scripts/extract_blocks.py")
arch=('x86_64' 'aarch64')
license=('GPL3')
depends=( 'fuse3' )
conflicts=('dwarfs')
provides=('dwarfs')
package() {
install -Dm755 "${srcdir}/dwarfs-universal-${pkgver}-Linux-${CARCH}-clang" "${pkgdir}/usr/bin/dwarfsuniversal"
install -Dm755 "${srcdir}/extract_blocks.py" "${pkgdir}/usr/bin/dwarfsblocks"
ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfsck"
ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfsextract"
ln -s dwarfsuniversal "${pkgdir}/usr/bin/mkdwarfs"
ln -s dwarfsuniversal "${pkgdir}/usr/bin/dwarfs"
# mount will just run dwarfsuniversal otherwise
printf '#!/bin/sh\ndwarfs "$@"' > "${pkgdir}/usr/bin/mount.dwarfs"
chmod 755 "${pkgdir}/usr/bin/mount.dwarfs"
cd "${srcdir}/dwarfs-${pkgver}-Linux-${CARCH}-clang"
install -Dm644 share/man/man1/dwarfs.1 "$pkgdir/usr/share/man/man1/dwarfs.1"
install -Dm644 share/man/man1/dwarfsck.1 "$pkgdir/usr/share/man/man1/dwarfsck.1"
install -Dm644 share/man/man1/dwarfsextract.1 "$pkgdir/usr/share/man/man1/dwarfsextract.1"
install -Dm644 share/man/man1/mkdwarfs.1 "$pkgdir/usr/share/man/man1/mkdwarfs.1"
install -Dm644 share/man/man5/dwarfs-format.5 "$pkgdir/usr/share/man/man5/dwarfs-format.5"
}
# update by removing and running `makepkg -g >> PKGBUILD`
sha256sums=('SKIP'
'SKIP'
'SKIP')

View file

@ -1,4 +1,6 @@
advancecomp
android-tools
anime4k-git
apparmor
arch-install-scripts
ares-emu-avx-git
@ -28,7 +30,6 @@ cpupower
csvlens
dart-sass
devkitpro-keyring
discord
doas-sudo-shim
dolphin-emu
dolphin-emu-tool
@ -153,6 +154,7 @@ python-html2text
python-lxml-html-clean
python-pip
python-pipx
python-playsound
python-pylint
python-readability-lxml
qbittorrent
@ -181,12 +183,12 @@ squashfs-tools
starship
steam
stow
subliminal-git
sxiv
syncplay
syncthing
system-config-printer
tig
tk
tldr
tmux
torsocks

6
arch/pacman.conf Normal file
View file

@ -0,0 +1,6 @@
[multilib]
Include = /etc/pacman.d/mirrorlist
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist
[options]
ParallelDownloads = 20

View file

@ -1,30 +1,38 @@
#!/bin/sh
set -e
alias g=git l='ln -s' p='s pacman --noconfirm' s=sudo t='s tee -a' w=wget
if command -v doas; then
alias s='doas'
fi
s pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
s pacman-key --lsign-key 3056513887B78AEB
p -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
printf '[chaotic-aur]\nInclude = /etc/pacman.d/chaotic-mirrorlist\n' | t /etc/pacman.conf
s pacman-key --recv BC26F752D25B92CE272E0F44F7FD5492264BB9D0 --keyserver keyserver.ubuntu.com
s pacman-key --lsign BC26F752D25B92CE272E0F44F7FD5492264BB9D0
p -U 'https://pkg.devkitpro.org/devkitpro-keyring.pkg.tar.xz'
printf '[dkp-libs]\nServer = https://pkg.devkitpro.org/packages\n' | t /etc/pacman.conf
printf "[dkp-linux]\nServer = https://pkg.devkitpro.org/packages/linux/\$arch/\n" | t /etc/pacman.conf
t /etc/pacman.conf < ~/.dotfiles/arch/pacman.conf
echo permit :wheel | t /etc/doas.conf
echo permit nopass :wheel | t /etc/doas.conf
p -Syu
xargs sudo pacman --noconfirm -S --needed < ~/.dotfiles/archpkgs
#shellcheck disable=SC2046
p -S --needed $(grep -v devkit ~/.dotfiles/arch/packages)
yay -S pandoc-bin shellcheck-bin --noconfirm
chsh -s "$(grep -m1 bin/fish /etc/shells)"
cp ~/.dotfiles/arch/dwarfs-universal /tmp/PKGBUILD
makepkg -srD /tmp
p -U /tmp/*.tar.zst
t /etc/pacman.conf < ~/.dotfiles/arch/devkitpro.conf
echo kernel.core_pattern=/dev/null | t /etc/sysctl.d/50-coredump.conf
echo options i915 enable_rc6=1 enable_fbc=1 lvds_downclock=1 enable__psr=1 | t /etc/modprobe.d/i915.conf
echo options lsm=landlock,lockdown,yama,integrity,apparmor,bpf | t /boot/loader/entries/*.conf
if bootctl status | grep systemd-boot; then
echo options lsm=landlock,lockdown,yama,integrity,apparmor,bpf | t /boot/loader/entries/*.conf
fi
mkdir -p ~/.parallel/will-cite ~/.config/aria2
stow --no-folding -d ~/.dotfiles -t ~/.config .
~/.dotfiles/bin/config.fish
s chsh -s "$(grep -m1 bin/fish /etc/shells)" "$USER"
w https://github.com/dracula/kitty/raw/master/dracula.conf -P ~/.config/kitty
w https://github.com/dracula/musikcube/raw/main/dracula.json -P ~/.config/musikcube/themes
@ -58,11 +66,10 @@ curl -L https://github.com/ngosang/trackerslist/raw/master/trackers_best.txt | t
g g p:appdwarf ~/.local/appdwarf
g g p:haiku-icons ~/.local/share/icons/Haiku
for i in ~/.dotfiles/dconf/*; do
dconf reset -f "$(basename "$i" | tr : /)"
#shellcheck disable=SC2094
dconf load "$(basename "$i" | tr : /)" < "$i"
done
s usermod -aG docker "$USER"
s usermod -aG input "$USER"
if test "$DBUS_SESSION_BUS_ADDRESS"; then
for i in ~/.dotfiles/dconf/*; do
dconf reset -f "$(basename "$i" | tr : /)"
#shellcheck disable=SC2094
dconf load "$(basename "$i" | tr : /)" < "$i"
done
fi